home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / pbclon20.zip / PBCLONE.MAN < prev    next >
Text File  |  1992-10-19  |  357KB  |  10,972 lines

  1.        PBClone 2.0  (c) 1990-1992  Thomas G. Hanlin III
  2.  
  3. Name  : AddMatI              (Add Matrix Integer)
  4. Class : Array management
  5. Level : Any
  6.  
  7. This routine adds an integer to as many elements of an integer
  8. array as you like, starting at a specified place in the array.
  9. It can also be used to subtract (just specify a negative
  10. value).  If there was a numeric overflow at any point in the
  11. operation, an error code will be returned.
  12.  
  13.    AddMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  14.  
  15. DSeg%      segment of the first array element to add
  16. DOfs%      offset of the first array element to add
  17. Elements%  number of array elements to which to add
  18. Value%     value to add to each array element
  19. -------
  20. ErrCode%   error code: 0 if no error
  21.  
  22. Name  : AddMatL              (Add Matrix Long integer)
  23. Class : Array management
  24. Level : Any
  25.  
  26. This routine adds a long integer to as many elements of an long
  27. integer array as you like, starting at a specified place in the
  28. array.  It can also be used to subtract (just specify a
  29. negative value).  If there was a numeric overflow at any point
  30. in the operation, an error code will be returned.
  31.  
  32.    AddMatL DSeg%, DOfs%, Elements%, Value&, ErrCode%
  33.  
  34. DSeg%      segment of the first array element to add
  35. DOfs%      offset of the first array element to add
  36. Elements%  number of array elements to which to add
  37. Value&     value to add to each array element
  38. -------
  39. ErrCode%   error code: 0 if no error
  40.  
  41. Name  : AllExtMem&           (All Extended Memory)
  42. Class : Equipment
  43. Level : Clone (AT)
  44.  
  45. This routine returns the amount of extended memory installed in
  46. the system, as reported by the power-on self-test (POST)
  47. routine at boot time.  This does not tell you how much extended
  48. memory is actually available, since extended memory may be
  49. carved up by users of BIOS-level extended memory or XMS memory,
  50. converted to expanded memory, etc.  It only tells you the
  51. amount of physical extended memory that is installed.
  52.  
  53. Do not use this routine on PC/XT machines. It is only for
  54. AT-class computers.
  55.  
  56.    TotalKb& = AllExtMem&
  57.  
  58. -------
  59. TotalKb&      kilobytes of extended memory installed
  60.  
  61. Name  : AltKey               (Alt Key)
  62. Class : Input
  63. Level : Any
  64.  
  65. This routine works in conjunction with a key input routine,
  66. such as INKEY$ or the CheckKey and GetKey routines.  Given the
  67. ASCII code and scan code of a key, AltKey returns the
  68. associated key letter, if any.  For instance, it returns "A" if
  69. you pass it ASCII code 0 and scan code 30, because those codes
  70. represent Alt-A.
  71.  
  72.    AltKey ASCIICode%, ScanCode%, Ky$
  73.  
  74. ASCIICode%   ASCII code of the key
  75. ScanCode%    scan code of the key
  76. -------
  77. Ky$          associated key letter ("" if none)
  78.  
  79. Name  : AndSt                (AND String)
  80. Class : String
  81. Level : Any
  82.  
  83. This routine ANDs each byte in one string with the
  84. corresponding byte in a second string.  The strings must be the
  85. same length.
  86.  
  87.    AndSt St1$, St2$
  88.  
  89. St1$      string to AND
  90. St2$      string to AND with
  91. -------
  92. St1$      result
  93.  
  94. Name  : Any2Dec              (Any to Decimal)
  95. Class : Numeric
  96. Level : Any
  97.  
  98. This routine converts a number in any base to a normal (base
  99. 10) integer.  It works like the &H and &O prefixes in BASIC,
  100. but rather than working only in hexadecimal (base 16) and octal
  101. (base 8), it can be used for binary, octal, or almost anything
  102. else.
  103.  
  104. If you specify base 10, you can use this routine to convert a
  105. signed integer (0-65,535) to a normal integer.
  106.  
  107.    Any2Dec Number$, NrBase%, DecNr%, ErrCode%
  108.  
  109. Number$   any-base number to convert to an integer
  110. NrBase%   number base to convert from
  111. -------
  112. DecNr%    resulting integer
  113. ErrCode%  error code: 0 if no error
  114.  
  115. Name  : AscI%                (ASC Integer)
  116. Class : String
  117. Level : Any
  118.  
  119. This is a replacement for the ASC function provided by BASIC.
  120. It is smaller than ASC, however, and also somewhat faster.
  121.  
  122. Unlike BASIC or ProBas, the PBClone AscI function returns -1 as
  123. an error condition if you try to use it on a null string.  This
  124. convention owes its origin to the similar routine in Crescent's
  125. libraries.
  126.  
  127. See also AscM%, which returns the ASCII code of a character at
  128. a specific location within a string.
  129.  
  130.    Value% = AscI%(St$)
  131.  
  132. St$        string for which to return ASCII code
  133. -------
  134. Value%     code of the first string char or -1 if null string
  135.  
  136. Name  : AscM%                (ASC MID$)
  137. Class : String
  138. Level : Any
  139.  
  140. This function works like a combination of the BASIC functions
  141. ASC and MID$.  It returns the ASCII code of a character at a
  142. specified position in a string.  If the specified position is
  143. outside the string, -1 will be returned.
  144.  
  145. See also AscI%, which returns the ASCII code of the character
  146. at the beginning of a string.
  147.  
  148.    Value% = AscM%(St$, Posn%)
  149.  
  150. St$        string to examine
  151. Posn%      character position to examine
  152. -------
  153. Value%     code of the specified character or -1 if error
  154.  
  155. Name  : BarMenu              (Bar Menu)
  156. Class : Input
  157. Level : Clone
  158.  
  159. This is a bar menu routine.  It allows the user to select one
  160. of a list of items given on a single menu row or "bar".  The
  161. current item is highlighted in your choice of colors; user
  162. selection can be done either by moving this highlight and
  163. pressing return or by entering the letter associated with the
  164. desired item.  Only text mode is supported.
  165.  
  166. The highlight may be moved with the left and right arrow keys,
  167. tab and backtab, or space and backspace.  Selection is done
  168. with <CR>, the enter key.
  169.  
  170. The letter used to select an item is the first character of the
  171. item that is not lowercase or a space.  If the item is all
  172. lowercase, the first character of the item will be used.  For
  173. example, suppose you want the user to select one of "list" or
  174. "log".  By passing the options to BarMenu as "List" and "lOg",
  175. you allow the user to press "L" for "List" and "O" for "lOg".
  176.  
  177. The user's choice will be returned to you as a number, with the
  178. first choice being numbered 1.  If <ESC> was pressed, 0 will be
  179. returned.
  180.  
  181.    BarMenu Pick$(), Row%, LCol%, RCol%, VAttr%, HiAttr%, Prompt$
  182.  
  183. Pick$()       list of items to choose from
  184. Row%          row on which to display the bar
  185. LCol%         leftmost column of the bar
  186. RCol%         rightmost column of the bar (use -1 for autosize)
  187. VAttr%        bar color/attribute (see CalcAttr)
  188. HiAttr%       bar highlight color/attribute (see CalcAttr)
  189. Prompt$       prompt text (displayed at left side of the bar)
  190. -------
  191. Row%          # of the chosen item (1-items, or 0 if <ESC>)
  192.  
  193. Name  : BarMenuM             (Bar Menu with Mouse)
  194. Class : Input, Mouse
  195. Level : Clone
  196.  
  197. This is a bar menu routine.  It functions just like BarMenu,
  198. but supports the use of a mouse as well as the keyboard.  Make
  199. sure the mouse cursor is visible before calling this routine!
  200.  
  201.    BarMenuM PickList$(), Row%, LeftCol%, RightCol%, VAttr%, _
  202.       HiAttr%, Prompt$, Mouse%, ShowCursor%
  203.  
  204. PickList$()   list of items to choose from
  205. Row%          row on which to display the bar
  206. LeftCol%      leftmost column of the bar
  207. RightCol%     rightmost column of the bar (use -1 for auto-sizing)
  208. VAttr%        bar color/attribute (see CalcAttr)
  209. HiAttr%       bar highlight color/attribute (see CalcAttr)
  210. Prompt$       prompt text (displayed at the left side of the bar)
  211. Mouse%        whether a mouse is available (0 no)
  212. ShowCursor%   not used
  213. -------
  214. Row%          number of the chosen item (1-items, or 0 if <ESC>)
  215.  
  216. Name  : Bickel               (Bickel comparison)
  217. Class : String
  218. Level : Any
  219.  
  220. A string comparison routine, Bickel allows you to see how
  221. closely two strings match.  The better the match, the larger
  222. the returned value will be.  Since there is no constant minimum
  223. or maximum value, this routine is best used for applications
  224. involving dictionary searches.  You would scan the dictionary
  225. and make a list of the best matches.  This is appropriate for a
  226. spelling checker, for instance.
  227.  
  228.    Bickel St1$, St2$, Result%
  229.  
  230. St1$      first string to compare
  231. St2$      second string to compare
  232. -------
  233. Result%   resulting "match magnitude" value
  234.  
  235. Name  : BigPrint             (Big Print)
  236. Class : Display
  237. Level : BIOS
  238.  
  239. As the name suggests, this routine displays text in large
  240. characters.  How large?  Eight times as high and as wide as
  241. normal!  Each "big character" will be composed of many
  242. normal-sized characters.  You may choose the normal character
  243. used to create the big characters (the default is a CHR$(219)
  244. solid block character, if you pass a null string here).
  245.  
  246. You should avoid using CHR$(128) to CHR$(255) when in either of
  247. the CGA graphics modes, as many CGAs are unable to display
  248. these characters when in graphics mode.
  249.  
  250.    BigPrint St$, FormCh$, Row%, Column%, VAttr%
  251.  
  252. St$       string to display in big characters
  253. FormCh$   character used to compose the big characters
  254. Row%      starting row
  255. Column%   starting column
  256. VAttr%    color/attribute of big characters (see CalcAttr)
  257.  
  258. Name  : BinSeekD             (Binary Seek Double precision)
  259. Class : Array management
  260. Level : Any
  261.  
  262. This routine uses binary search techniques to locate a specific
  263. number in a sorted double-precision array.  Each number in the
  264. array must be unique (no duplicates) for this to work.  This is
  265. a very, very fast routine and is especially handy for look-up
  266. tables.
  267.  
  268. The array is expected to begin at element 1.  You may specify
  269. the maximum element to search, allowing use of only part of an
  270. array.
  271.  
  272. A single number is returned in Posn%.  If Posn% is greater than
  273. zero, the target number was found and Posn% is the position in
  274. the array where it was found.  If Posn% is negative, the target
  275. number was not found, but it could be inserted into the array
  276. at the -Posn% element.  If the number is zero, the target
  277. number was not found and there is no room in the array to add
  278. any more values.
  279.  
  280.    BinSeekD Array#(), Elements%, Target#, Posn%
  281.  
  282. Array#()    array of sorted, unique values to search
  283. Elements%   maximum array element to search
  284. Target#     value to look for
  285. -------
  286. Posn%       whether and where the target was found (see above)
  287.  
  288. Name  : BinSeekI             (Binary Seek Integer)
  289. Class : Array management
  290. Level : Any
  291.  
  292. This routine uses binary search techniques to locate a specific
  293. number in a sorted integer array.  Each number in the array
  294. must be unique (no duplicates) for this to work.  This is a
  295. very, very fast routine and is especially handy for look-up
  296. tables.
  297.  
  298. The array is expected to begin at element 1.  You may specify
  299. the maximum element to search, allowing use of only part of an
  300. array.
  301.  
  302. A single number is returned in Posn%.  If Posn% is greater than
  303. zero, the target number was found and Posn% is the position in
  304. the array where it was found.  If Posn% is negative, the target
  305. number was not found, but it could be inserted into the array
  306. at the -Posn% element.  If the number is zero, the target
  307. number was not found and there is no room in the array to add
  308. any more values.
  309.  
  310.    BinSeekI Array%(), Elements%, Target%, Posn%
  311.  
  312. Array%()    array of sorted, unique values to search
  313. Elements%   maximum array element to search
  314. Target%     value to look for
  315. -------
  316. Posn%       whether and where the target was found (see above)
  317.  
  318. Name  : BinSeekL             (Binary Seek Long integer)
  319. Class : Array management
  320. Level : Any
  321.  
  322. This routine uses binary search techniques to locate a specific
  323. number in a sorted long integer array.  Each number in the
  324. array must be unique (no duplicates) for this to work.  This is
  325. a very, very fast routine and is especially handy for look-up
  326. tables.
  327.  
  328. The array is expected to begin at element 1.  You may specify
  329. the maximum element to search, allowing use of only part of an
  330. array.
  331.  
  332. A single number is returned in Posn%.  If Posn% is greater than
  333. zero, the target number was found and Posn% is the position in
  334. the array where it was found.  If Posn% is negative, the target
  335. number was not found, but it could be inserted into the array
  336. at the -Posn% element.  If the number is zero, the target
  337. number was not found and there is no room in the array to add
  338. any more values.
  339.  
  340.    BinSeekL Array&(), Elements%, Target&, Posn%
  341.  
  342. Array&()    array of sorted, unique values to search
  343. Elements%   maximum array element to search
  344. Target&     value to look for
  345. -------
  346. Posn%       whether and where the target was found (see above)
  347.  
  348. Name  : BinSeekS             (Binary Seek Single precision)
  349. Class : Array management
  350. Level : Any
  351.  
  352. This routine uses binary search techniques to locate a specific
  353. number in a sorted single-precision array.  Each number in the
  354. array must be unique (no duplicates) for this to work.  This is
  355. a very, very fast routine and is especially handy for look-up
  356. tables.
  357.  
  358. The array is expected to begin at element 1.  You may specify
  359. the maximum element to search, allowing use of only part of an
  360. array.
  361.  
  362. A single number is returned in Posn%.  If Posn% is greater than
  363. zero, the target number was found and Posn% is the position in
  364. the array where it was found.  If Posn% is negative, the target
  365. number was not found, but it could be inserted into the array
  366. at the -Posn% element.  If the number is zero, the target
  367. number was not found and there is no room in the array to add
  368. any more values.
  369.  
  370.    BinSeekS Array!(), Elements%, Target!, Posn%
  371.  
  372. Array!()    array of sorted, unique values to search
  373. Elements%   maximum array element to search
  374. Target!     value to look for
  375. -------
  376. Posn%       whether and where the target was found (see above)
  377.  
  378. Name  : BinSeekSt            (Binary Seek String)
  379. Class : Array management
  380. Level : Any
  381.  
  382. This routine uses binary search techniques to locate a specific
  383. string in a sorted string array.  Each string in the array must
  384. be unique (no duplicates) for this to work.  This is a very,
  385. very fast routine and is especially handy for look-up tables.
  386.  
  387. The string array is expected to begin at element 1.  You may
  388. specify the maximum element to search, allowing use of only
  389. part of an array.  You must specify whether capitalization
  390. matters-- set CapsCount% to 0 if it doesn't.
  391.  
  392. A single number is returned in Posn%.  If the number is greater
  393. than zero, the target string was found, and the number is the
  394. position in the array where it was found.  If the number is
  395. negative, the target string was not found, but it could be
  396. inserted into the array at the -Posn% element.  If the number
  397. is zero, the target string was not found and there is no room
  398. in the array to add any more values.
  399.  
  400.    BinSeekSt Array$(), Elements%, Target$, CapsCount%, Posn%
  401.  
  402. Array$()    array of sorted, unique values to search
  403. Elements%   maximum array element to search
  404. Target$     string to look for
  405. CapsCount%  0 if capitalization doesn't matter
  406. -------
  407. Posn%       whether and where the target was found (see above)
  408.  
  409. Name  : BIOSInkey            (BIOS INKEY$)
  410. Class : Input
  411. Level : BIOS
  412.  
  413. BIOSInkey works like INKEY$, but it gets its key directly by
  414. asking the BIOS. The primary advantage of this is that you get
  415. the "scan" code as well as the ASCII code of the key.  The scan
  416. code is independent of the shift status-- for instance, the
  417. scan code for "A" is the same as the scan code for "a" or
  418. Control-A or Alt-A.  This can be very handy.
  419.  
  420. If there is no key available, both the scan code and ASCII code
  421. will be zero.
  422.  
  423.    BIOSInkey AscCode%, ScanCode%
  424.  
  425. -------
  426. AscCode%    ASCII code of the key, if any
  427. ScanCode%   scan code of the key, if any
  428.  
  429. Name  : BkScroll             (Backward Scroll)
  430. Class : Display
  431. Level : BIOS
  432.  
  433. This routine scrolls any selected part of the display down-- it
  434. does a backwards scroll.  You may scroll as many times as you
  435. like, or scroll "zero" times to totally clear the selected part
  436. of the display.
  437.  
  438. Note that BIOS-level scrolling can cause the screen to flicker
  439. on some CGAs due to a combination of unfortunate design factors.
  440.  
  441.    BkScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  442.  
  443. TopRow%      top row of the area to scroll
  444. LeftCol%     left column of the area to scroll
  445. BottomRow%   top row of the area to scroll
  446. RightCol%    left column of the area to scroll
  447. Times%       number of times (or rows) to scroll
  448.  
  449. Name  : BkSpace              (Backspace)
  450. Class : Display
  451. Level : BIOS
  452.  
  453. Although CHR$(8) is supposed to mean "backspace", it shows up
  454. as a graphics character when BASIC prints it.  This routine
  455. does an actual backspace with full wrap-- if it's at the
  456. beginning of the line, it will move back to the previous line
  457. (if there is one).  It backspaces destructively (erasing the
  458. previous character) from the current cursor position.  The new
  459. cursor is returned to you, since QuickBASIC may ignore the new
  460. status.
  461.  
  462.    BkSpace Row%, Column%       ' do the backspace
  463.    LOCATE Row%, Column%        ' inform QuickBASIC
  464.  
  465. -------
  466. Row%      new row
  467. Column%   new column
  468.  
  469. Name  : Blink                (Blink toggle)
  470. Class : Display
  471. Level : BIOS / Clone (see text)
  472.  
  473. It is possible to make characters in text mode blink by giving
  474. them an appropriate "color".  I wouldn't mention something so
  475. obvious but for another possibility which is less widely known:
  476. blinking can be turned off, in which case the characters that
  477. would have otherwise blinked will instead have a bright
  478. background.  In other words, turn off blinking, and you double
  479. the possible number of background colors.
  480.  
  481. This technique will always work with EGA and VGA displays.  It
  482. can also be used with MDA/Hercules and CGA displays, on which
  483. it will almost always work... unfortunately, on some
  484. less-than-perfect PC clones, it will cause the computer to lock
  485. up instead.  So, be careful with this one!
  486.  
  487.    Blink SetBlink%
  488.  
  489. SetBlink%    use blink (-1) or intense backgrounds (0)
  490.  
  491. Name  : BlockMove            (Block memory Move)
  492. Class : Memory
  493. Level : Clone
  494.  
  495. This routine allows you to copy or "move" a block of data from
  496. one memory location to another.  It isn't very bright, so if
  497. the memory areas overlap, you will have to tell the routine to
  498. "move backwards" instead of forwards. In that case, you will
  499. also have to change the offsets to point to the ends of the
  500. memory areas instead of the beginnings.
  501.  
  502. Normally, you can use forward moves.  In that case, the offsets
  503. you specify are those of the beginning of the memory areas.  If
  504. backward moves are required, the offsets specified are those of
  505. the end of the memory areas.
  506.  
  507. If you are familiar with assembly language, you may recognize
  508. this as a straightforward implementation of the "REP MOVSB"
  509. instruction.
  510.  
  511. You may move up to 65,520 bytes at a time, provided that the
  512. addresses are in normalized form (if you don't know what this
  513. means, you probably don't need to worry about it).
  514.  
  515. This routine can be used to copy information to an array from
  516. any area of memory (the BIOS data area, the screen, another
  517. array, etc), or vice versa. It can also be used to do things
  518. like insert/delete elements from an array, scroll the screen,
  519. fill the screen with a specified character, and so on.
  520.  
  521.    BlockMove FromSeg%, FromOfs%, ToSeg%, ToOfs%, Bytes&, Dirn%
  522.  
  523. FromSeg%    segment of the area from which to copy
  524. FromOfs%    offset of the area from which to copy
  525. ToSeg%      segment of the area to which to copy
  526. ToOfs%      offset of the area to which to copy
  527. Bytes&      number of bytes to copy (0-65,520)
  528. Dirn%       direction to copy (0 if forward, else backward)
  529.  
  530. Name  : BootDrive            (get Boot Drive)
  531. Class : Disk
  532. Level : DOS 4.0+
  533.  
  534. This routine tells you which drive was used to boot the
  535. system.  See also BootDrive2, a function version of this
  536. routine.
  537.  
  538. One use for BootDrive would be in installation programs, to
  539. determine the most likely destination drive for your software.
  540.  
  541.    Drive$ = "x"
  542.    BootDrive Drive$
  543.  
  544. -------
  545. Drive$   boot drive-- set it to at least one char beforehand!
  546.  
  547. Name  : BootDrive2$          (get Boot Drive)
  548. Class : Disk
  549. Level : DOS 4.0+
  550.  
  551. This routine tells you which drive was used to boot the system.
  552.  
  553. One use for BootDrive2 would be in installation programs, to
  554. determine the most likely destination drive for your software.
  555.  
  556.    Drive$ = BootDrive2$
  557.  
  558. -------
  559. Drive$   boot drive (null if wrong DOS version)
  560.  
  561. Name  : BRead                (Byte Read)
  562. Class : Disk
  563. Level : DOS
  564.  
  565. This routine reads a byte from a file into an integer.  The
  566. byte is zero-extended into the integer, providing a value that
  567. may range from 0-255.
  568.  
  569. The file must have been opened using FCreate or FOpen1.
  570.  
  571.    BRead Handle%, Value%, ErrCode%
  572.  
  573. Handle%    file handle
  574. -------
  575. Value%     byte read from file
  576. ErrCode%   DOS error code (0 if no error)
  577.  
  578. Name  : BreakCheck%          (Break key Check)
  579. Class : Input
  580. Level : BIOS
  581.  
  582. This routine is for use after BreakOff.  It allows you to see
  583. whether the Break key has been pressed since you last checked.
  584. The Break status is cleared after the value is returned.
  585.  
  586.    Brk% = BreakCheck%
  587.    IF Brk% THEN
  588.       PRINT "** Break key pressed **"
  589.       GOTO EndProgram
  590.    END IF
  591.  
  592. -------
  593. Brk%    whether Break was pressed (0 no, -1 yes)
  594.  
  595. Name  : BreakOff             (Break key Off)
  596. Class : Input
  597. Level : BIOS
  598.  
  599. This routine disables the Break key.  It is not effective in
  600. the QB or QBX environments, as these use their own keyboard
  601. handler.  It is also not effective if your program was compiled
  602. with Debugging on (/D switch).
  603.  
  604. Note that BreakOff installs a routine to intercept some
  605. interrupt vectors. You MUST use the BreakOffDone routine to
  606. reverse this process before your program ends, or the computer
  607. will be left in an indeterminate state and will probably crash
  608. the next time Break is pressed!
  609.  
  610.    BreakOff
  611.  
  612. Name  : BreakOffDone         (Break key Off routine Done)
  613. Class : Input
  614. Level : BIOS
  615.  
  616. This routine is used after BreakOff to restore the original
  617. interrupt vectors.  If you use BreakOff, you MUST call
  618. BreakOffDone before your program ends!  Otherwise, the computer
  619. will probably crash the next time someone presses Break.
  620.  
  621.    BreakOffDone
  622.  
  623. Name  : BSq                  (Blank Squeeze)
  624. Class : String
  625. Level : Any
  626.  
  627. A simple compression routine, BSq "squeezes" the blank spaces
  628. in a string. It is designed expressly for use with text data.
  629. The text may not contain more than 131 spaces in a row, or
  630. CHR$(128) through CHR$(255), which are used in the compression.
  631.  
  632. Average text files are liable to be compressed by around 16%.
  633. Files that contain more spaces, such as structured programs,
  634. will benefit more.  The compression algorithm is simple but
  635. extremely fast, adding no noticeable overhead to string
  636. processing.
  637.  
  638. See also BUsq, BUsqLen.
  639.  
  640.    BSq St$, StLen%
  641.    St$ = LEFT$(St$, StLen%)
  642.  
  643. St$     string to compress
  644. -------
  645. St$     compressed string
  646. StLen%  length of the compressed string
  647.  
  648. Name  : BUsq                 (Blank Unsqueeze)
  649. Class : String
  650. Level : Any
  651.  
  652. This routine is used to uncompress strings that were processed
  653. by BSq. Before uncompression, the BUsqLen routine must be used
  654. to find out how long the resulting string will be.
  655.  
  656. See also BSq, BUsqLen.
  657.  
  658.    BUsqLen St$, StLen%
  659.    IF StLen% < 0 THEN
  660.       PRINT "Error in compressed string"
  661.    ELSE
  662.       Result$ = SPACE$(StLen%)
  663.       BUsq St$, Result$
  664.    END IF
  665.  
  666. St$      string to uncompress
  667. -------
  668. Result$  uncompressed string
  669.  
  670. Name  : BUsqLen              (Blank Unsqueeze Length)
  671. Class : String
  672. Level : Any
  673.  
  674. This routine is used in coordination with BUsq to uncompress
  675. strings that were processed by BSq.  It determines what the
  676. length of the uncompressed string will be, which is necessary
  677. to initialize the string for BUsq.
  678.  
  679. See also BSq, BUsq.
  680.  
  681.    BUsqLen St$, StLen%
  682.    IF StLen% < 0 THEN
  683.       PRINT "Error in compressed string"
  684.    ELSE
  685.       Result$ = SPACE$(StLen%)
  686.       BUsq St$, Result$
  687.    END IF
  688.  
  689. St$      string to uncompress
  690. -------
  691. StLen%   length of the uncompressed string
  692.  
  693. Name  : BWrite               (Byte Write)
  694. Class : Disk
  695. Level : DOS
  696.  
  697. This routine writes a byte to a file from an integer.  The
  698. least significant byte of the integer is written.
  699.  
  700. The file must have been opened using FCreate or FOpen1.
  701.  
  702.    BWrite Handle%, Value%, ErrCode%
  703.  
  704. Handle%    file handle
  705. Value%     byte to write to file
  706. -------
  707. ErrCode%   DOS error code (0 if no error)
  708.  
  709. Name  : CalcAttr             (Calculate Attribute)
  710. Class : Display
  711. Level : Any
  712.  
  713. Many of the display routines in this library require an
  714. "attribute" rather than foreground and background colors.  An
  715. attribute is a combination of the foreground and background
  716. colors in a format which is used by all types of displays when
  717. in text mode.
  718.  
  719. Foreground colors are usually specified as 0-31, with
  720. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  721. may be more convenient to express the same thing as foreground
  722. 0-15, background 0-15.  The CalcAttr routine will accept either
  723. way of expressing it.
  724.  
  725. Note, however, that UnCalcAttr will always return the former
  726. pair of results, since it has no way of knowing whether Blink
  727. has been used (foreground 0-31, background 0-15).  See
  728. UnCalcAttr for more details and a solution.
  729.  
  730. See also CalcAttr2, the FUNCTION version of this routine.
  731.  
  732.    CalcAttr Foreground%, Background%, VAttr%
  733.  
  734. Foreground%  foreground color
  735. Background%  background color
  736. -------
  737. VAttr%       color "attribute"
  738.  
  739. Name  : CalcAttr2%           (Calculate Attribute)
  740. Class : Display
  741. Level : Any
  742.  
  743. Many of the display routines in this library require an
  744. "attribute" rather than foreground and background colors.  An
  745. attribute is a combination of the foreground and background
  746. colors in a format which is used by all types of displays when
  747. in text mode.
  748.  
  749. Foreground colors are usually specified as 0-31, with
  750. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  751. may be more convenient to express the same thing as foreground
  752. 0-15, background 0-15.  The CalcAttr2 routine will accept
  753. either way of expressing it.
  754.  
  755. Note, however, that UnCalcAttr will always return the former
  756. pair of results, since it has no way of knowing whether Blink
  757. has been used (foreground 0-31, background 0-15).  See
  758. UnCalcAttr for more details and a solution.
  759.  
  760. See also CalcAttr, the SUB version of this routine.
  761.  
  762.    VAttr% = CalcAttr2%(Foreground%, Background%)
  763.  
  764. Foreground%  foreground color
  765. Background%  background color
  766. -------
  767. VAttr%       color "attribute"
  768.  
  769. Name  : CalcDate             (Calculate Date)
  770. Class : Time
  771. Level : Any
  772.  
  773. This routine calculates what the date will be a given number of
  774. days from now, either in the past or the future.  Actually, you
  775. may use any starting date, not just the current date.  An error
  776. code is returned if the starting date or resulting date are not
  777. valid.  Dates may not preceed January 1, 1900.
  778.  
  779. CalcDate accepts the date in any standard form ("01/30/91" or
  780. "01-30-1991", for example) and returns its results in the same
  781. format.
  782.  
  783.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  784.  
  785. StartDate$   starting date
  786. Days&        number of days from the current date (0 or more)
  787. Direction%   return future result (0) or past (nonzero)
  788. -------
  789. NewDate$     resulting date
  790. ErrCode%     whether the dates are valid (0 yes)
  791.  
  792. Name  : CalcSize             (Calculate array Size)
  793. Class : Display
  794. Level : Any
  795.  
  796. This routine calculates the necessary DIM size for an integer
  797. array, assuming that you intend to store display data in the
  798. array.  This is most useful in conjunction with DGetScreen and
  799. GetScreen.
  800.  
  801.    CalcSize TopRow%, LeftCol%, BottomRow%, RightCol%, Elements%
  802.    DIM Array%(1 TO Elements%)
  803.  
  804. TopRow%      top row of the display area
  805. LeftCol%     left column of the display area
  806. BottomRow%   top row of the display area
  807. RightCol%    left column of the display area
  808. -------
  809. Elements%    required size of the integer array
  810.  
  811. Name  : CalcVGAColor         (Calculate VGA palette Color)
  812. Class : Display
  813. Level : Any
  814.  
  815. The QuickBASIC manual gives a cumbersome formula for
  816. calculating VGA palette colors.  This routine does it faster
  817. and with less fuss.  All you need to do is pass it the
  818. appropriate intensity values (0-63) and you get back a long
  819. integer, just the way BASIC wants it.
  820.  
  821.    CalcVGAColor Red%, Green%, Blue%, Colour&
  822.  
  823. Red%      red   intensity
  824. Green%    green intensity
  825. Blue%     blue  intensity
  826. -------
  827. Colour&   color value for use in the PALETTE statement
  828.  
  829. Name  : Carrier              (detect Carrier)
  830. Class : Serial
  831. Level : Clone
  832.  
  833. If you write communications programs, particularly things like
  834. doors and BBSes, you probably want to keep an eye on the
  835. carrier.  BASIC won't do it, but we will!
  836.  
  837.    Carrier CommPort%, CarrierHigh%
  838.  
  839. CommPort%     serial port (1-4, though BASIC only handles 1-2)
  840. -------
  841. CarrierHigh%  zero if no carrier
  842.  
  843. Name  : CatchError           (Catch Error from SHELL)
  844. Class : Miscellaneous
  845. Level : Clone
  846.  
  847. NOTE: You should use the GetError2% function in preference to
  848. this set of routines.
  849.  
  850. The CatchError routine is used in conjunction with GetError.
  851. It lets you get the exit code (error level) returned by a
  852. program to which you have SHELLed. Since CatchError hooks an
  853. interrupt to do its work, you must always make sure to use
  854. GetError afterwards to "clean up".  See also GetError.
  855.  
  856. Note that differences in DOS mean that this routine will not
  857. always work.  In some versions of DOS, you can only get the
  858. error level if a batch file was executed; in others, you can't
  859. get the error level from a batch file at all. Sorry about
  860. that.  I don't know of any way to work around it.
  861.  
  862.    CatchError
  863.    SHELL ProgramName$
  864.    GetError ExitCode%
  865.  
  866. Name  : CDROM                (check for CD-ROM)
  867. Class : Disk / Equipment
  868. Level : DOS
  869.  
  870. This routine tells you whether the Microsoft CD-ROM Extensions
  871. are installed. If so, it tells you what the letter of the first
  872. CD-ROM logical drive is and how many logical drives exist.
  873.  
  874. Note: The CD-ROM installation check conflicts with the
  875. GRAPHICS.COM installation check for DOS 4.0, due to some
  876. screw-up at IBM or Microsoft. This may cause unexpected
  877. results.  I'm not yet sure whether DOS 5.0 is similarly
  878. afflicted.
  879.  
  880.    FirstDrive$ = "x"
  881.    CDROM FirstDrive$, Drives%
  882.  
  883. -------
  884. FirstDrive$   letter of first logical drive (init to >= 1 char)
  885. Drives%       number of logical drives (0 if no CD-ROM)
  886.  
  887. Name  : CDROM2%              (check for CD-ROM)
  888. Class : Disk / Equipment
  889. Level : DOS
  890.  
  891. This routine tells you whether the Microsoft CD-ROM Extensions
  892. are installed. If so, it tells you how many logical drives
  893. exist.
  894.  
  895. Note: The CD-ROM installation check conflicts with the
  896. GRAPHICS.COM installation check for DOS 4.0, due to some
  897. screw-up at IBM or Microsoft. This may cause unexpected
  898. results.  I'm not yet sure whether DOS 5.0 is similarly
  899. afflicted.
  900.  
  901.    Drives% = CDROM2%
  902.  
  903. -------
  904. Drives%       number of logical drives (0 if no CD-ROM)
  905.  
  906. Name  : CeilD#               (Ceiling, Double-precision)
  907. Class : String
  908. Level : Any
  909.  
  910. This function returns the smallest integer greater than or
  911. equal to the number you give it.  This is most often used for
  912. rounding.
  913.  
  914.    Result# = CeilD#(Nr#)
  915.  
  916. Nr#          number to process
  917. -------
  918. Result#      result
  919.  
  920. Name  : CeilS!               (Ceiling, Single-precision)
  921. Class : String
  922. Level : Any
  923.  
  924. This function returns the smallest integer greater than or
  925. equal to the number you give it.  This is most often used for
  926. rounding.
  927.  
  928.    Result! = CeilS!(Nr!)
  929.  
  930. Nr!          number to process
  931. -------
  932. Result!      result
  933.  
  934. Name  : CenterSt$            (Center String)
  935. Class : String
  936. Level : Any
  937.  
  938. This function returns a string centered in a field of spaces.
  939.  
  940.    Result$ = CenterSt$(StToCenter$, Columns%)
  941.  
  942. StToCenter$   string to center
  943. Columns%      width of field in which to center string
  944. -------
  945. Result$       field of spaces with string centered in it
  946.  
  947. Name  : CheckDate            (Check Date validity)
  948. Class : Time
  949. Level : Any
  950.  
  951. This routine checks a date to see if it is valid.
  952.  
  953.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  954.  
  955. MonthNr%     month number (1-12)
  956. DayNr%       day number (1-31)
  957. YearNr%      year number (1900 on; years <100 assumed 1900s)
  958. -------
  959. ErrCode%     whether the date is valid (0 yes)
  960.  
  961. Name  : CheckDisk            (Check Disk readiness)
  962. Class : Disk
  963. Level : DOS
  964.  
  965. The CheckDisk routine determines whether a disk is ready.
  966. About the only thing it won't tell you is if a disk is
  967. write-protected or out of space. Since the PBClone disk
  968. routines all contain critical error handling, which reports
  969. back an appropriate error code for all such problems, this
  970. routine isn't really needed any more.  It's included for
  971. compatibility with older ProBas programs.
  972.  
  973. Results will normally be returned as one of the following,
  974. although not all DOS versions report the exact cause of the
  975. error, in which case the error number may not mean what you
  976. expect.
  977.  
  978.    0   no error
  979.    1   unformatted disk
  980.    2   open drive door
  981.    3   bad drive spec
  982.  
  983.    CheckDisk Drive$, ErrCode%
  984.  
  985. Drive$    letter of the drive to check
  986. -------
  987. ErrCode%  0 if no error, nonzero for error (see above)
  988.  
  989. Name  : CheckDsk%            (Check Disk readiness)
  990. Class : Disk
  991. Level : DOS
  992.  
  993. The CheckDsk% function determines whether a disk is ready.
  994. About the only thing it won't tell you is if a disk is
  995. write-protected or out of space. Since the PBClone disk
  996. routines all contain critical error handling, which reports
  997. back an appropriate error code for all such problems, this
  998. routine isn't really needed any more.  It's included for
  999. compatibility with older ProBas programs.
  1000.  
  1001. Note that DOS versions before 3.0 do not return as useful error
  1002. codes as later versions.  Under such circumstances, both
  1003. "unformatted disk" and "open drive door" will be returned as
  1004. "open drive door".
  1005.  
  1006.    ErrCode% = CheckDsk%(Drive$)
  1007.  
  1008. Drive$    letter of the drive to check
  1009.  
  1010. Name  : CheckKey             (Check for Key or mouse)
  1011. Class : Input, Mouse
  1012. Level : BIOS
  1013.  
  1014. This routine is kind of an extended version of INKEY$.  It
  1015. checks the keyboard to see if any key is available and gets the
  1016. key if it is.  At your option, it can also check the mouse to
  1017. see if a button has been pressed.
  1018.  
  1019.    CheckKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  1020.  
  1021. Mouse%        whether to check the mouse (0: no)
  1022. -------
  1023. ASCIIcode%    ASCII code of the key pressed
  1024. ScanCode%     scan code of the key pressed (0 if none)
  1025. LButton%      whether the left  mouse button was pressed
  1026. RButton%      whether the right mouse button was pressed
  1027.  
  1028. Name  : CheckKey3            (Check for Key or 3-button mouse)
  1029. Class : Input, Mouse
  1030. Level : BIOS
  1031.  
  1032. This routine is kind of an extended version of INKEY$.  It
  1033. checks the keyboard to see if any key is available and gets the
  1034. key if it is.  At your option, it can also check the mouse to
  1035. see if a button has been pressed.
  1036.  
  1037.    CheckKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  1038.       MButton%, RButton%
  1039.  
  1040. Mouse%        whether to check the mouse (0: no)
  1041. -------
  1042. ASCIIcode%    ASCII code of the key pressed
  1043. ScanCode%     scan code of the key pressed (0 if none)
  1044. LButton%      whether the left   mouse button was pressed
  1045. MButton%      whether the middle mouse button was pressed
  1046. RButton%      whether the right  mouse button was pressed
  1047.  
  1048. Name  : CheckShare           (Check for SHARE)
  1049. Class : Disk
  1050. Level : DOS
  1051.  
  1052. The CheckShare routine determines whether SHARE.EXE is active.
  1053. This is particularly helpful before using the BASIC OPEN
  1054. statement, which will fail if you request file sharing when
  1055. it's not available.  The PBClone file routines handle such
  1056. situations automatically, so CheckShare is not needed for them.
  1057.  
  1058.    CheckShare ShareActive%
  1059.  
  1060. -------
  1061. ShareActive%   whether SHARE is active (0 if no)
  1062.  
  1063. Name  : CheckShare2%         (Check for SHARE)
  1064. Class : Disk
  1065. Level : DOS
  1066.  
  1067. The CheckShare2% function determines whether SHARE.EXE is
  1068. active.  This is particularly helpful before using the BASIC
  1069. OPEN statement, which will fail if you request file sharing
  1070. when it's not available.  The PBClone file routines handle such
  1071. situations automatically, so CheckShare2% is not needed for
  1072. them.
  1073.  
  1074.    ShareActive% = CheckShare2%
  1075.  
  1076. -------
  1077. ShareActive%   whether SHARE is active (0 if no)
  1078.  
  1079. Name  : Checksum             (calculate Checksum)
  1080. Class : String / Serial
  1081. Level : Any
  1082.  
  1083. The Checksum routine calculates a checksum on a string.  The
  1084. resulting number is compatible with Xmodem and Ymodem checksum
  1085. routines and will vary from 0-255.  This checksum provides a
  1086. minimal, but fast, check of what characters are contained in
  1087. the string.  See also CRC1.
  1088.  
  1089.    Checksum St$, ChkSum%
  1090.  
  1091. St$       string to process
  1092. -------
  1093. ChkSum%   checksum of the characters in the string
  1094.  
  1095. Name  : Cipher               (Cipher)
  1096. Class : String
  1097. Level : Any
  1098.  
  1099. This is a very simple text encryption routine.  It isn't
  1100. particularly hard to crack, but will provide a basic level of
  1101. security for undemanding applications.  The same routine can be
  1102. used either to encrypt or decrypt text.  The original text may
  1103. contain any character; likewise, the resulting text.  This is
  1104. not well suited for use with sequential files-- if such is
  1105. required, see CipherP.
  1106.  
  1107. I'd suggest using a long password composed of an unlikely
  1108. string of characters, e.g. "#*@@!A^%x{.'".
  1109.  
  1110.    Cipher St$, Password$
  1111.  
  1112. St$        string to encrypt or decrypt
  1113. Password$  password
  1114. -------
  1115. St$        encrypted or decrypted string
  1116.  
  1117. Name  : CipherP              (Cipher Printable)
  1118. Class : String
  1119. Level : Any
  1120.  
  1121. This is a very simple text encryption routine.  It isn't
  1122. particularly hard to crack, but will provide a basic level of
  1123. security for undemanding applications.  The same routine can be
  1124. used either to encrypt or decrypt text.  The original text may
  1125. contain any character below CHR$(128), as may the password.
  1126. The resulting text will be printable, if bizarre (all
  1127. characters will be above CHR$(127)), and may be used with
  1128. sequential files.
  1129.  
  1130. This routine is potentially less secure than the Cipher routine
  1131. (see).
  1132.  
  1133. I'd suggest using a long password composed of an unlikely
  1134. string of characters, e.g. "#*@@!A^%x{.'".
  1135.  
  1136.    CipherP St$, Password$
  1137.  
  1138. St$        string to encrypt or decrypt
  1139. Password$  password
  1140. -------
  1141. St$        encrypted or decrypted string
  1142.  
  1143. Name  : ClearArea            (Clear a screen Area)
  1144. Class : Display
  1145. Level : Clone
  1146.  
  1147. This routine clears an area of the screen to a specified
  1148. color.  The clearing is done by removing random characters
  1149. until the area is totally clear.
  1150.  
  1151.    ClearArea TRow%, LCol%, BRow%, RCol%, VAttr%, Fast%
  1152.  
  1153. TRow%       top row of area to clear
  1154. LCol%       left column of area to clear
  1155. BRow%       bottom row of area to clear
  1156. RCol%       right column of area to clear
  1157. VAttr%      color/attribute to clear to
  1158. Fast%       whether to use fast displays (0 no)
  1159.  
  1160. Name  : Clock                (Clock)
  1161. Class : Display / Time
  1162. Level : Clone
  1163.  
  1164. This routine allows you to turn a visible time display on or
  1165. off.  When on, the time will be continuously displayed at a
  1166. selected location while your program continues processing.  The
  1167. clock is managed as a background process, in effect doing some
  1168. simple multitasking.
  1169.  
  1170. You should turn the clock off before you terminate your
  1171. program, including any time you execute another program with
  1172. RUN.  The clock can be safely kept on when you SHELL to another
  1173. program, however, as long as you can be sure that control will
  1174. return to your program when the other is done.
  1175.  
  1176. The clock must also be turned off if you change any of its
  1177. parameters with the ClockSet routine (see).
  1178.  
  1179. The clock will only be visible when the display is in text
  1180. mode.  The use of PLAY or SOUND statements may shut off the
  1181. clock, depending on your version of the BASIC compiler.
  1182.  
  1183.    Clock DisplayOn%
  1184.  
  1185. DisplayOn%   whether to display the clock (0 if no)
  1186.  
  1187. Name  : ClockSet             (Clock Settings)
  1188. Class : Display / Time
  1189. Level : Clone
  1190.  
  1191. The ClockSet routine is used in conjunction with Clock (see).
  1192. It should only be used when the clock is turned off.
  1193.  
  1194. This routine allows you to set 12-hour or 24-hour time, whether
  1195. to display the seconds or not, how often to update the clock
  1196. display (in 1/18th seconds; 9 is usually the best choice),
  1197. where to display the clock and in what color, and whether to
  1198. use flicker-free displays (needed for cheap CGAs only).  The
  1199. defaults are 12-hour time, display seconds, put the time (in
  1200. white on black) in the upper right corner, and display quickly
  1201. (may flicker on some CGAs).
  1202.  
  1203.    ClockSet Hours24%, Seconds%, Updates%, Row%, Column%, _
  1204.       VAttr%, Fast%
  1205.  
  1206. Hours24%   whether to display 24-hour time (0 if no)
  1207. Seconds%   whether to display seconds (0 if no)
  1208. Updates%   display update frequency in 1/18th seconds
  1209. Row%       row on which to display the clock
  1210. Col%       column at which to display the clock
  1211. VAttr%     color/attribute to use (see CalcAttr)
  1212. Fast%      whether to use fast mode (0 no)
  1213.  
  1214. Name  : CloseA               (Close Archive)
  1215. Class : Disk / Time
  1216. Level : DOS
  1217.  
  1218. This routine closes an archive opened by FindFirstA or
  1219. FindNextA.  It must be used when you are done searching the
  1220. archive.
  1221.  
  1222. Routines in this series include:
  1223.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  1224.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  1225.  
  1226.    CloseA
  1227.  
  1228. Name  : ClrCols              (Clear Columns)
  1229. Class : Display
  1230. Level : BIOS
  1231.  
  1232. This routine clears the current row between the specified
  1233. columns, inclusive. It does not affect the cursor position.
  1234.  
  1235.    ClrCols StartCol%, EndCol%
  1236.  
  1237. StartCol%  starting column
  1238. EndCol%    ending column
  1239.  
  1240. Name  : ClrEOL               (Clear to End Of Line)
  1241. Class : Display
  1242. Level : BIOS
  1243.  
  1244. This routine clears from the cursor to the end of the line,
  1245. inclusive.  It does not affect the current cursor position.
  1246.  
  1247.    ClrEOL
  1248.  
  1249. Name  : ClrEOP               (Clear to End Of Page)
  1250. Class : Display
  1251. Level : BIOS
  1252.  
  1253. This routine clears from the cursor to the end of the display,
  1254. inclusive.  It does not affect the current cursor position.
  1255.  
  1256.    ClrEOP
  1257.  
  1258. Name  : ClrKbd               (Clear Keyboard buffer)
  1259. Class : Input
  1260. Level : DOS
  1261.  
  1262. ClrKbd clears the keyboard buffer, discarding any keys that may
  1263. be waiting. This is a good idea for situations where an
  1264. unexpected input is made and you don't want to chance it being
  1265. answered accidentally by keys that were typed beforehand-- for
  1266. instance, in the event of an error or other condition where it
  1267. is important that the user see a message or take an action
  1268. before pressing a key.
  1269.  
  1270.    ClrKbd
  1271.  
  1272. Name  : ClrSOL               (Clear to Start Of Line)
  1273. Class : Display
  1274. Level : BIOS
  1275.  
  1276. This routine clears from the start of the line to the cursor,
  1277. inclusive.  It does not affect the current cursor position.
  1278.  
  1279.    ClrSOL
  1280.  
  1281. Name  : ClrSOP               (Clear to Start Of Page)
  1282. Class : Display
  1283. Level : BIOS
  1284.  
  1285. This routine clears from the start of the display to the
  1286. cursor, inclusive. It does not affect the current cursor
  1287. position.
  1288.  
  1289.    ClrSOP
  1290.  
  1291. Name  : CopyFile             (Copy a File)
  1292. Class : Disk
  1293. Level : DOS
  1294.  
  1295. This works like the DOS COPY command, although it does not
  1296. allow wildcards. One file is copied to another, retaining the
  1297. same date and time.  Full path specifications are supported,
  1298. including drive and subdirectory specs.
  1299.  
  1300. See also FileCopy, which supports wildcards.
  1301.  
  1302.    CopyFile FromFile$, ToFile$, ErrCode%
  1303.  
  1304. FromFile$   name of file to copy
  1305. ToFile$     name of new file to create
  1306. -------
  1307. ErrCode%    0 if no error, else DOS Error
  1308.  
  1309. Name  : CPrintScreen1        (CGA Print Screen [SCREEN 1])
  1310. Class : Display / Printer
  1311. Level : Clone
  1312.  
  1313. This routine dumps a SCREEN 1 display (CGA 320x200) to the
  1314. printer.  It uses the stdprn device (normally PRN or LPT1) by
  1315. default, although this can be altered with the PrtSwap routine.
  1316.  
  1317.    CPrintScreen1
  1318.  
  1319. Name  : CPrintScreen2        (CGA Print Screen [SCREEN 2])
  1320. Class : Display / Printer
  1321. Level : Clone
  1322.  
  1323. This routine dumps a SCREEN 2 display (CGA 640x200) to the
  1324. printer.  It uses the stdprn device (normally PRN or LPT1) by
  1325. default, although this can be altered with the PrtSwap routine.
  1326.  
  1327.    CPrintScreen2
  1328.  
  1329. Name  : CPUSpeed%            (CPU Speed)
  1330. Class : Equipment
  1331. Level : Clone
  1332.  
  1333. This function returns the approximate CPU speed in MHz.  It may
  1334. take several seconds to find the speed of slower processors, so
  1335. don't expect an immediate response.  Results can be skewed by
  1336. multitasking and background processing.
  1337.  
  1338.    MHz% = CPUSpeed%
  1339.  
  1340. -------
  1341. MHz%       approximate CPU speed
  1342.  
  1343. Name  : CRC                  (calculate CRC)
  1344. Class : String / Serial
  1345. Level : Any
  1346.  
  1347. This routine has become obsolete; the CRC1 routine is much
  1348. faster.  However, CRC is still included for backwards
  1349. compatibility.
  1350.  
  1351. This routine calculates a complex 16-bit checksum, called a
  1352. Cyclical Redundancy Check (or CRC) on a string.  The results
  1353. are compatible with Xmodem and Ymodem CRC routines.  The CRC
  1354. provides a fairly reliable check of what characters are
  1355. contained in the string.  See also Checksum.
  1356.  
  1357. If you are using this routine for Xmodem or Ymodem, note that
  1358. the string should be padded with two null characters before
  1359. calculating a "send" CRC: St$ = St$ + STRING$(2, 0).  On
  1360. receive, you should calculate the CRC on the entire data block,
  1361. plus the received CRC; if the block was received correctly, the
  1362. calculated CRC will be zero in both lsb and msb.
  1363.  
  1364. Although Intel notation uses "lsb, msb" order, the
  1365. Xmodem/Ymodem CRC uses the opposite format, which is why the
  1366. parameters are ordered in this fashion.
  1367.  
  1368.    CRC St$, CRCmsb%, CRClsb%
  1369.  
  1370. St$       string to process
  1371. -------
  1372. CRCmsb%   most significant byte of CRC
  1373. CRClsb%   least significant byte of CRC
  1374.  
  1375. Name  : CRC1                 (calculate CRC)
  1376. Class : String / Serial
  1377. Level : Any
  1378.  
  1379. This routine calculates a complex 16-bit checksum, called a
  1380. Cyclical Redundancy Check (or CRC) on a string.  The results
  1381. are compatible with Xmodem and Ymodem CRC routines.  The CRC
  1382. provides a fairly reliable check of what characters are
  1383. contained in the string.  See also Checksum.
  1384.  
  1385. Note that CRC1 does not work like the older CRC routine.  You
  1386. should not pad outgoing strings with a STRING$(2, 0) sequence.
  1387.  
  1388. Although Intel notation uses "lsb, msb" order, the
  1389. Xmodem/Ymodem CRC uses the opposite format, which is why the
  1390. parameters are ordered in this fashion.
  1391.  
  1392.    CRC St$, CRCmsb%, CRClsb%
  1393.  
  1394. St$       string to process
  1395. -------
  1396. CRCmsb%   most significant byte of CRC
  1397. CRClsb%   least significant byte of CRC
  1398.  
  1399. Name  : Crunch               (Crunch repeated characters)
  1400. Class : String
  1401. Level : Any
  1402.  
  1403. It was hard to decide on a name for this routine, and I don't
  1404. know if I've done the best job.  What Crunch does is to
  1405. eliminate repeated sequences of the same character.  For
  1406. instance, if you gave it "This    is a   test" and asked it to
  1407. crunch spaces, it would return "This is a test".  I use this to
  1408. filter information from the COMMAND$ function, but it's a good
  1409. general purpose input filter.
  1410.  
  1411.    Crunch St$, Ch$, StLen%
  1412.    St$ = LEFT$(St$, StLen%)
  1413.  
  1414. St$       string to be processed
  1415. Ch$       character to crunch out of the string
  1416. -------
  1417. St$       crunched string
  1418. StLen%    length of the crunched string
  1419.  
  1420. Name  : CtrlKey              (Control Key)
  1421. Class : Input
  1422. Level : Any
  1423.  
  1424. This routine works in conjunction with a key input routine,
  1425. such as INKEY$ or the CheckKey and GetKey routines.  Given the
  1426. ASCII code of a key, CtrlKey returns the associated key letter,
  1427. if any.  For instance, it returns "A" if you pass it ASCII code
  1428. 1, because that code represents Ctrl-A.
  1429.  
  1430.    CtrlKey ASCIICode%, Ky$
  1431.  
  1432. ASCIICode%   ASCII code of the key
  1433. -------
  1434. Ky$          associated key letter ("" if none)
  1435.  
  1436. Name  : CursorInfo           (Cursor Information)
  1437. Class : Input
  1438. Level : Clone
  1439.  
  1440. While BASIC allows you to set the size and shape of the cursor
  1441. with LOCATE, it's fairly hazardous to do so.  There is no way
  1442. to find out the maximum size of the cursor, so your cursor may
  1443. end up a peculiar shape on some adapters. If you change the
  1444. cursor size or visibility in a subprogram, you may be screwing
  1445. up the main program.
  1446.  
  1447. CursorInfo offers a solution to these problems.  It returns the
  1448. current cursor visibility and size, plus the maximum size
  1449. possible with the current video adapter.  The minimum size will
  1450. always be zero, so it is not reported.
  1451.  
  1452.    CursorInfo Visible%, StartLine%, EndLine%, MaxLine%
  1453.  
  1454. -------
  1455. Visible%      whether the cursor is visible (0 no, 1 yes)
  1456. StartLine%    starting scan line of cursor
  1457. EndLine%      ending scan line of cursor
  1458. MaxLine%      maximum possible scan line for cursor
  1459.  
  1460. Name  : CWindowManager       (CGA Window Manager)
  1461. Class : Display
  1462. Level : Clone
  1463.  
  1464. CWindowManager displays a pop-up window on a CGA graphics
  1465. screen.  It is intended for SCREEN 1, although it can be used
  1466. on SCREEN 2 as well (it will still have 40 columns and will
  1467. display shades rather than colors).  The window may have any of
  1468. a variety of frames, a title, or a shadow, and it may appear
  1469. instantly or "grow" onto the screen.
  1470.  
  1471. These are the available frame types:
  1472.     0   no frame
  1473.     1   single lines
  1474.     2   double lines
  1475.     3   single horizontal, double vertical lines
  1476.     4   double horizontal, single vertical lines
  1477.     5   block graphic lines
  1478.  
  1479. Options for growing windows are as follows:
  1480.    -1   grow as fast as possible
  1481.     0   pop onto the screen
  1482.    1+   grow with delay given in milliseconds (15 works for me)
  1483.  
  1484. Note that this routine is different from its ProBas equivalent
  1485. in a number of respects.  The grow delay time is different.
  1486. Growing is done more smoothly. The shadow and title parameters
  1487. are not changed by this routine.  A new frame type (5) was
  1488. added.  If a title is too long, it is truncated instead of
  1489. being ignored completely.  Using a -1 as the title foreground
  1490. color will not turn off the title; instead, use a null title
  1491. string.
  1492.  
  1493.    CWindowManager TRow%, LCol%, BRow%, RCol%, Frame%,
  1494.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Fast%
  1495.  
  1496. TRow%       top row of window
  1497. LCol%       left column of window
  1498. BRow%       bottom row of window
  1499. RCol%       right column of window
  1500. Frame%      frame type (see above)
  1501. Fore%       frame foreground color
  1502. Back%       frame background color
  1503. Grow%       window growing option (see above)
  1504. Shade%      window shadow option (0 for none)
  1505. TFore%      title foreground color
  1506. Title$      window title ("" if none)
  1507. Fast%       whether to use fast mode (0 no)
  1508.  
  1509. Name  : DataSeg              (Data Segment)
  1510. Class : Memory
  1511. Level : Any
  1512.  
  1513. It's rare that you need to know the data segment used by BASIC,
  1514. but it does happen.  DataSeg tells you that value.  This is the
  1515. segment used by (near) strings, static arrays (except in the
  1516. QuickBASIC environment), some COMMON data, BASIC internal
  1517. variables and so forth.  It is also the area specified by a
  1518. plain "DEF SEG", though not (usually) by "DEF SEG=xxxx".
  1519.  
  1520.    DataSeg DSeg%
  1521.  
  1522. -------
  1523. DSeg%     data segment for BASIC
  1524.  
  1525. Name  : Date2Int             (Date to Integer)
  1526. Class : Time
  1527. Level : Any
  1528.  
  1529. This routine compresses a date into a single integer.  Note
  1530. that this integer is not in a format that lends itself to
  1531. simple computation-- you cannot subtract one from another to
  1532. find out the length of time between them. However, as long as
  1533. the year is in the range 1980-2042, you can compare the two
  1534. integers to see if one date is before or after another.
  1535.  
  1536. You may express the year as either a two-digit or four-digit
  1537. number.
  1538.  
  1539. The ProBas and PBClone versions of this routine do not work the
  1540. same way in regards to the year.  ProBas assumed that any
  1541. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1542. that years 80-99 should be converted to 1980-1999 and that 0-79
  1543. should be converted to 2000-2079.  I consider the PBClone
  1544. method more appropriate, with the turn of the century moving
  1545. closer. The date format used does not allow dates before 1980
  1546. anyway, so nothing is being lost by this change.
  1547.  
  1548.    Date2Int MonthNr%, DayNr%, YearNr%, IntDate%
  1549.  
  1550. MonthNr%     month number (1-12)
  1551. DayNr%       day (1-31)
  1552. YearNr%      year (1980-2079; see above for two-digit years)
  1553. -------
  1554. IntDate%     date compressed into an integer
  1555.  
  1556. Name  : DateA2R              (Date Actual to Relative)
  1557. Class : Time
  1558. Level : Any
  1559.  
  1560. This routine converts an actual date to a relative date,
  1561. expressed as a number of days.  This allows you to compare
  1562. dates, find out what the date will be in a given number of days
  1563. (or what it was a given number of days ago), see how many days
  1564. passed between two dates, and so forth.
  1565.  
  1566. I've frequently seen routines of this nature called "Julian
  1567. date" routines. I'm not sure where that nomenclature
  1568. originated, as it has nothing to do with the Julian calendar.
  1569. Most of these routines rely on approximations through floating
  1570. point math, and may or may not handle leap years and centuries
  1571. appropriately.  The DateA2R routine takes no such shortcuts and
  1572. may be relied upon to return accurate results.
  1573.  
  1574.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  1575.  
  1576. MonthNr%     month number (1-12)
  1577. DayNr%       day number (1-31)
  1578. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  1579. -------
  1580. RelDate&     relative date
  1581.  
  1582. Name  : DateN2S              (Date Numbers to String)
  1583. Class : Time
  1584. Level : Any / DOS
  1585.  
  1586. Many of the PBClone routines return the date as a set of
  1587. numbers.  This routine provides an easy way to convert those
  1588. numbers into string form.  The date format used (year length
  1589. and delimiter) will be based on the string which you pass to
  1590. the routine.  For instance, "xx-xx-xxxx" will return a date
  1591. like "11-26-1990", whereas "xx.xx.xxxx" would return
  1592. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  1593.  
  1594. If you pass zeroes for the MonthNr%, DayNr%, and YearNr%
  1595. values, the current date will be returned in the format that
  1596. you specified.
  1597.  
  1598. The ProBas and PBClone versions of this routine do not work the
  1599. same way in regards to the year.  ProBas assumed that any
  1600. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1601. that years 80-99 should be converted to 1980-1999 and that 0-79
  1602. should be converted to 2000-2079.
  1603.  
  1604.    DateSt$ = "xx-xx-xxxx"
  1605.    DateN2S MonthNr%, DayNr%, YearNr%, DateSt$
  1606.  
  1607. MonthNr%  month
  1608. DayNr%    day
  1609. YearNr%   year
  1610. -------
  1611. DateSt$   date string.  Init to 8 or 10 chars (see above).
  1612.  
  1613. Name  : DateR2A              (Date Relative to Actual)
  1614. Class : Time
  1615. Level : Any
  1616.  
  1617. This is the opposite of the DateA2R routine-- it takes a
  1618. "relative" date and converts it back to the usual form.
  1619.  
  1620.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  1621.  
  1622. RelDate&     relative date
  1623. -------
  1624. MonthNr%     month number (1-12)
  1625. DayNr%       day number (1-31)
  1626. YearNr%      year number (1900 on)
  1627.  
  1628. Name  : DateS2N              (Date String to Numbers)
  1629. Class : Time
  1630. Level : Any
  1631.  
  1632. Many of the PBClone routines need to be passed the date as a
  1633. set of numbers. This routine provides an easy way to convert a
  1634. date from string form into numbers.  You may use either
  1635. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  1636. length is important, but the delimiter and contents of the
  1637. string are ignored).
  1638.  
  1639. The ProBas and PBClone versions of this routine do not work the
  1640. same way in regards to the year.  ProBas assumed that any
  1641. two-digit year was in the 1900s.  In contrast, PBClone assumes
  1642. that years 80-99 should be converted to 1980-1999 and that 0-79
  1643. should be converted to 2000-2079.
  1644.  
  1645.    DateS2N MonthNr%, DayNr%, YearNr%, DateSt$
  1646.  
  1647. DateSt$   date string.  Init to 8 or 10 characters (see above).
  1648. -------
  1649. MonthNr%  month
  1650. DayNr%    day
  1651. YearNr%   year
  1652.  
  1653. Name  : DCal                 (Direct-to-memory Calendar)
  1654. Class : Time
  1655. Level : Any
  1656.  
  1657. This routine draws a calendar for a specific month and year.
  1658. The results are placed in an array which can be displayed using
  1659. ScrRest or the other PBClone routines to restore a screen image.
  1660.  
  1661. You must supply an integer array large enough to hold the image
  1662. generated by DCal, which expects a 25x80 screen.  DIM Scrn%(1
  1663. TO 2000) will do it.  If you supply a null date, the current
  1664. date will be used.
  1665.  
  1666.    DCal Scrn%(), CalDate$
  1667.  
  1668. Scrn%()      array to hold screen image
  1669. CalDate$     date for the calendar
  1670. Page%        ignored
  1671. Fast%        ignored
  1672.  
  1673. Name  : DCalendar            (Direct-to-memory Calendar)
  1674. Class : Time
  1675. Level : Clone
  1676.  
  1677. This routine displays a calendar for a specific month and
  1678. year.  It waits for input and acts accordingly, allowing the
  1679. user to move to different dates via the arrow keys or by
  1680. entering the date directly. The bottom row of the screen gives
  1681. a list of the available key commands.
  1682.  
  1683. Screen handling is largely done by writing to an array, then
  1684. dumping the entire array to the display with DScrRest.  This
  1685. provides for very smooth displays.  You must supply an integer
  1686. array large enough to hold the image generated by DCalendar,
  1687. which expects a 25x80 screen.  DIM Scrn%(1 TO 2000) will do
  1688. it.  Only text mode is supported by this routine.
  1689.  
  1690. If you supply a null date, the current date will be used.
  1691.  
  1692.    DCalendar Scrn%(), CalDate$, Page%, Fast%
  1693.  
  1694. Scrn%()      array to hold screen image
  1695. CalDate$     date for the calendar
  1696. Page%        page on which to display (normally zero)
  1697. Fast%        whether to use fast mode (0 no)
  1698.  
  1699. Name  : DClear               (Direct-to-memory Clear)
  1700. Class : Display
  1701. Level : Any
  1702.  
  1703. The DClear routine allows you to clear a text-mode display.
  1704.  
  1705. This routine does not necessarily work on the display itself.
  1706. Instead, it allows you to specify the memory location (segment
  1707. and offset) of the "screen", which may be an actual screen, a
  1708. saved screen in an array, a multitasker's virtual screen, etc.
  1709. Among other things, this makes it easy to work with two
  1710. displays at once: use a segment of &HB000 for the mono display
  1711. and &HB800 for the color display (the offset in each case is
  1712. zero).
  1713.  
  1714.    DClear DSeg%, DOfs%, VAttr%
  1715.  
  1716. DSeg%    segment of "screen" memory
  1717. DOfs%    offset of "screen" memory
  1718. VAttr%   color/attribute to use (see CalcAttr)
  1719.  
  1720. Name  : DClearSS             (Direct Clear for Specified Size)
  1721. Class : Display
  1722. Level : Any
  1723.  
  1724. Like the CLS statement, this routine allows you to clear a text
  1725. display. However, rather than clearing the actual screen,
  1726. DClearSS clears a screen that is stored in an array.  This
  1727. allows you to design a screen in memory, then flash it onto the
  1728. display using PutScreen or a similar routine.
  1729.  
  1730. This routine is designed for a text screen of any specified
  1731. size.
  1732.  
  1733.    DClearSS DSeg%, DOfs%, VAttr%, Rows%, Columns%
  1734.  
  1735. DSeg%     segment of the array that holds the screen
  1736. DOfs%     offset of the array that holds the screen
  1737. VAttr%    color/attribute to use (see CalcAttr)
  1738. Rows%     length of the screen
  1739. Columns%  width of the screen
  1740.  
  1741. Name  : Dec2Any              (Decimal to Any base)
  1742. Class : Numeric
  1743. Level : Any
  1744.  
  1745. This routine converts a normal integer to a number in any
  1746. base.  It works like the HEX$ function in BASIC, but rather
  1747. than working only in hexadecimal (base 16), it can be used for
  1748. binary, octal, or almost anything else.
  1749.  
  1750. The result will be right-justified in the string you provide.
  1751. If you use zeroes, this allows you to ignore the NumberLen%
  1752. spec and just trim the string to the desired length, leaving
  1753. nothing worse than possible leading zeroes.
  1754.  
  1755. The length needed by the return string will vary according to
  1756. the number, with a maximum length depending on the number base
  1757. chosen.  For integers, this will be at most 16 characters
  1758. (worst case: base 2 or binary).
  1759.  
  1760.    Number$ = STRING$(16, "0")
  1761.    Dec2Any DecimalNr%, NrBase%, Number$, NumberLen%
  1762.    Number$ = RIGHT$(Number$, NumberLen%)
  1763.  
  1764. DecimalNr   integer to convert to another base
  1765. NrBase%     desired number base (2-31)
  1766. -------
  1767. Number$     resulting number in desired base (init >= 16 chars)
  1768. NumberLen%  length of the result (-1 if string too short)
  1769.  
  1770. Name  : Delay                (Delay for seconds)
  1771. Class : Time
  1772. Level : Clone
  1773.  
  1774. This routine delays for a given number of seconds.  The timing
  1775. will be the same from an 8088 PC through an 80486 AT-- it's
  1776. entirely independent of the processor.  See also Delay18th.
  1777.  
  1778.    Delay Seconds%
  1779.  
  1780. Seconds%   number of seconds for which to delay
  1781.  
  1782. Name  : Delay18th            (Delay for 1/18th seconds)
  1783. Class : Time
  1784. Level : Clone
  1785.  
  1786. This routine delays for a given number of 18ths of seconds.
  1787. The timing will be the same from an 8088 PC through an 80486
  1788. AT-- it's entirely independent of the processor.  See also
  1789. Delay.
  1790.  
  1791.    Delay WaitTime%
  1792.  
  1793. WaitTime%  number of 18ths of seconds for which to delay
  1794.  
  1795. Name  : DelayV               (Delay based on Video timing)
  1796. Class : Time
  1797. Level : Clone
  1798.  
  1799. This routine delays for a given number of milliseconds.  The
  1800. timing is based on a signal from the video adapter and may vary
  1801. somewhat depending on the adapter.  The delay is largely
  1802. independent of the cpu type and speed, however.
  1803.  
  1804. For anyone unfamiliar with the metric system: there are 1000
  1805. milliseconds in one second.  Depending on the specific display
  1806. adapter, this routine may well be fairly inaccurate; it is
  1807. intended for providing small delays for animation and similar
  1808. purposes, not as a reliable timer.
  1809.  
  1810.    DelayV MilliSeconds%
  1811.  
  1812. MilliSeconds%   number of milliseconds for which to delay
  1813.  
  1814. Name  : DelChr               (Delete Character)
  1815. Class : Display
  1816. Level : Clone
  1817.  
  1818. The DelChr routine deletes the character at the specified
  1819. screen location.
  1820.  
  1821.    DelChr Row%, Column%
  1822.  
  1823. Row%      row of character
  1824. Column%   column of character
  1825.  
  1826. Name  : DelFile              (Delete File)
  1827. Class : Disk
  1828. Level : DOS
  1829.  
  1830. This works like the DOS DEL (or ERASE) command, although it
  1831. does not allow wildcards.  The specified file is deleted.  Full
  1832. path specifications are supported, including drive and
  1833. subdirectory specs.
  1834.  
  1835.    DelFile FileName$, ErrCode%
  1836.  
  1837. FileName$   name of the file to delete
  1838. -------
  1839. ErrCode%    0 if no error, else DOS Error
  1840.  
  1841. Name  : DelLine              (Delete Line)
  1842. Class : Display
  1843. Level : BIOS
  1844.  
  1845. This routine deletes the specified row from the screen.
  1846.  
  1847.    DelLine Row%, VAttr%
  1848.  
  1849. Row%      row to delete
  1850. VAttr%    color/attr to use on new bottom row (see CalcAttr)
  1851.  
  1852. Name  : DelSub               (Delete Subdirectory)
  1853. Class : Disk
  1854. Level : DOS
  1855.  
  1856. This works like the DOS RD (or RMDIR) command.  It does not
  1857. allow wildcards. The specified subdirectory is deleted.  Note
  1858. that you may not delete a subdirectory that you're located in,
  1859. or a subdirectory which contains files, or the root directory.
  1860.  
  1861.    DelSub SubDir$, ErrCode%
  1862.  
  1863. SubDir$     name of the subdirectory to delete
  1864. -------
  1865. ErrCode%    0 if no error, else DOS Error
  1866.  
  1867. Name  : DFRead               (Direct-to-memory File Read)
  1868. Class : Disk
  1869. Level : DOS
  1870.  
  1871. This routine reads data into an array from a file that was
  1872. opened by FOpen1 or FCreate.  If it wasn't possible to read it
  1873. all from the file, an error code will be returned and the
  1874. BytesRead% value will tell you how many bytes were actually
  1875. read.
  1876.  
  1877.    DFRead Handle%, DSeg%, DOfs%, Bytes%, BytesRead%, ErrCode%
  1878.  
  1879. Handle%     handle of the file from which to read
  1880. DSeg%       segment of the array into which to read the file
  1881. DOfs%       offset of the array into which to read the file
  1882. Bytes%      number of bytes to read
  1883. -------
  1884. BytesWrit%  # of bytes actually read from the file (if error)
  1885. ErrCode%    error code: 0 if no error, else DOS Error
  1886.  
  1887. Name  : DFWrite              (Direct-from-memory File Write)
  1888. Class : Disk
  1889. Level : DOS
  1890.  
  1891. This routine writes data from an array to a file that was
  1892. opened by FOpen1 or FCreate.  If it wasn't possible to write it
  1893. all to the file, an error code will be returned and the
  1894. BytesWrit% value will tell you how many bytes were actually
  1895. written.
  1896.  
  1897.    DFWrite Handle%, DSeg%, DOfs%, Bytes%, BytesWrit%, ErrCode%
  1898.  
  1899. Handle%     handle of the file to which to write
  1900. DSeg%       segment of the data to write to the file
  1901. DOfs%       offset of the data to write to the file
  1902. Bytes%      number of bytes to write
  1903. -------
  1904. BytesWrit%  # of bytes actually written to the file (if error)
  1905. ErrCode%    error code: 0 if no error, else DOS Error
  1906.  
  1907. Name  : DGClear              (Direct-to-memory Graphics Clear)
  1908. Class : Display
  1909. Level : Any
  1910.  
  1911. This routine works like the CLS statement, clearing a CGA
  1912. graphics display. However, rather than clearing the actual
  1913. screen, DClearSS clears a screen that is stored in an array.
  1914. This allows you to design a screen in memory, then flash it
  1915. onto the display using GrafRest.
  1916.  
  1917. This routine is designed for use with SCREEN 1 or SCREEN 2 (CGA
  1918. graphics).
  1919.  
  1920.    DGClear DSeg%, DOfs%, Colour%
  1921.  
  1922. DSeg%     segment of the array that holds the screen
  1923. DOfs%     offset of the array that holds the screen
  1924. Colour%   color to use
  1925.  
  1926. Name  : DGetRec              (Direct-from-memory Get Record)
  1927. Class : String
  1928. Level : Clone
  1929.  
  1930. The DGetRec routine allows you to get a string from a specified
  1931. area of memory (numeric array, BIOS data area, display memory,
  1932. or whatever).  The string should be initialized to the desired
  1933. record length in advance.
  1934.  
  1935. This works somewhat like an array of fixed length strings or a
  1936. random file, treating memory as a contiguous series of records
  1937. of a specified length.
  1938.  
  1939.    DGetRec DSeg%, DOfs%, RecNr%, St$
  1940.  
  1941. DSeg%      segment of the array to read from
  1942. DOfs%      offset of the array to read from
  1943. RecNr%     record number (starting at 1)
  1944. -------
  1945. St$        returned string.  Init to record length (see above).
  1946.  
  1947. Name  : DGetScreen           (Direct memory Get Screen image)
  1948. Class : Display
  1949. Level : Clone
  1950.  
  1951. This routine saves any portion of the display to an array.
  1952. Only text modes are supported.  If your program uses multiple
  1953. display pages, you can get an image from any of those pages.  A
  1954. special "slow" mode is supported for the CGA, to prevent
  1955. flickering (a problem only with some CGAs).
  1956.  
  1957. The size of the integer array needed to store a specific area
  1958. of the screen can be calculated using the CalcSize routine
  1959. (see).
  1960.  
  1961. The GetScreen routine works the same way as this, but has a
  1962. simpler calling convention.  Also, if you wish to save the
  1963. entire screen, you may find ScrSave easier.
  1964.  
  1965.    DGetScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  1966.       Page%, Fast%
  1967.  
  1968. DSeg%      segment of the array in which to store the image
  1969. DOfs%      offset of the array in which to store the image
  1970. TRow%      top row of the desired screen area
  1971. LCol%      left column of the desired screen area
  1972. BRow%      bottom row of the desired screen area
  1973. RCol%      right column of the desired screen area
  1974. Page%      page from which to get the display area
  1975. Fast%      whether to use fast mode (0 no)
  1976.  
  1977. Name  : DGetSt               (Direct-from-memory Get String)
  1978. Class : String
  1979. Level : Clone
  1980.  
  1981. The DGetSt routine allows you to get a string from a specified
  1982. area of memory (numeric array, BIOS data area, display memory,
  1983. or whatever).  The string should be initialized to the desired
  1984. length in advance.
  1985.  
  1986. You may specify an additional offset from the initial location,
  1987. which itself is specified as a segment and an offset.  The
  1988. second offset begins with position 1.  The combined total of
  1989. the two offsets must be under 65,536 at the moment.  I'll
  1990. remove that restriction at a later time.  With normalized
  1991. segment and offset specifications, which is usually the case,
  1992. this allows you to specify a number from 1-65,521 for the
  1993. second offset.
  1994.  
  1995.    DGetSt DSeg%, DOfs%, Posn&, St$
  1996.  
  1997. DSeg%      segment of the array to read from
  1998. DOfs%      offset of the array to read from
  1999. Posn&      location relative to the start of the array
  2000. -------
  2001. St$        returned string.  Init to # of chars desired.
  2002.  
  2003. Name  : DGQPrint             (Direct Graphics Quick Print)
  2004. Class : Display
  2005. Level : Any
  2006.  
  2007. This is a simple high-speed replacement for the PRINT statement
  2008. which works on a CGA virtual graphics screen (SCREEN 2).  It
  2009. does not interpret control codes or support graphics characters
  2010. (ASCII 128-255).
  2011.  
  2012. DGQPrint allows you to display to a CGA even if it isn't the
  2013. active display (use a segment of &HB800 and offset of 0).  Its
  2014. intended use, however, is to display to a virtual screen kept
  2015. in an array or other memory area.  The results can then be
  2016. displayed using GrafRest.
  2017.  
  2018.    DGQPrint DSeg%, DOfs%, St$, Row%, Column%
  2019.  
  2020. DSeg%    segment of CGA virtual screen
  2021. DOfs%    offset of CGA virtual screen
  2022. St$      string to display
  2023. Row%     row (1-25)
  2024. Column%  column (1-80)
  2025.  
  2026. Name  : DGXQPrint            (Direct Graphics Extended Q Print)
  2027. Class : Display
  2028. Level : Any
  2029.  
  2030. This is a simple high-speed replacement for the PRINT statement
  2031. which works on a CGA virtual graphics screen (SCREEN 1).  It
  2032. does not interpret control codes or support graphics characters
  2033. (ASCII 128-255).
  2034.  
  2035. This routine can also be used on a SCREEN 2 display, where it
  2036. will display the string in shades instead of in color (using 40
  2037. columns/row).
  2038.  
  2039. DGXQPrint allows you to display to a CGA even if it isn't the
  2040. active display (use a segment of &HB800 and offset of 0).  Its
  2041. intended use, however, is to display to a virtual screen kept
  2042. in an array or other memory area.  The results can then be
  2043. displayed using GrafRest.
  2044.  
  2045.    DGXQPrint DSeg%, DOfs%, St$, Row%, Column%, Fore%
  2046.  
  2047. DSeg%    segment of CGA virtual screen
  2048. DOfs%    offset of CGA virtual screen
  2049. St$      string to display
  2050. Row%     row (1-25)
  2051. Column%  column (1-40)
  2052. Fore%    foreground color (0-3)
  2053.  
  2054. Name  : DGXQPrint1           (Direct Graphics Extended Q Print)
  2055. Class : Display
  2056. Level : Any
  2057.  
  2058. This is a high-speed replacement for the PRINT statement which
  2059. works on a CGA virtual graphics screen (SCREEN 1). It does not
  2060. interpret control codes.
  2061.  
  2062. This routine can also be used on a SCREEN 2 display, where it
  2063. will display the string in shades instead of in color (using 40
  2064. columns/row).
  2065.  
  2066. DGXQPrint1 allows you to display to a CGA even if it isn't the
  2067. active display (use a segment of &HB800 and offset of 0).  Its
  2068. intended use, however, is to display to a virtual screen kept
  2069. in an array or other memory area.  The results can then be
  2070. displayed using GrafRest.
  2071.  
  2072.    DGXQPrint1 DSeg%, DOfs%, St$, Row%, Column%, Fore%, Back%
  2073.  
  2074. DSeg%    segment of CGA virtual screen
  2075. DOfs%    offset of CGA virtual screen
  2076. St$      string to display
  2077. Row%     row (1-25)
  2078. Column%  column (1-40)
  2079. Fore%    foreground color (0-3)
  2080. Back%    background color (0-3)
  2081.  
  2082. Name  : DInput               (Dollar Input)
  2083. Class : Input
  2084. Level : Clone
  2085.  
  2086. This routine provides formatted input of a dollar amount.  You
  2087. specify the format and an initial value (may be zero).  You may
  2088. also specify whether to allow negation-- if so, the user may
  2089. press the "-" key to toggle the number between negative and
  2090. positive.  The numeric keypad will automatically be locked into
  2091. the numeric state.  Since the decimal point is implicit, the
  2092. "." key functions as a delete or backspace operation, for
  2093. convenient one-handed data entry and correction.
  2094.  
  2095. The dollar amount is kept in a long integer as a number of
  2096. pennies, to avoid the possibility of round-off errors which
  2097. might result from use of floating point math.  The results are
  2098. returned to you both as a long integer and as a formatted
  2099. number.
  2100.  
  2101. The format string works just like a PRINT USING format string.
  2102. Editing is not as flexible as for SInput, but is quite
  2103. adequate.  The SInputSet routines will work for DInput as well
  2104. as SInput.  The ExitCode% returned is the same as for SInput,
  2105. but left and right arrows may also be returned.
  2106.  
  2107.    DInput Format$, St&, St$, MinusOk%, VAttr%, ExitCode%
  2108.  
  2109. Format$    numeric format (just like PRINT USING format)
  2110. St&        dollar amount (in pennies)
  2111. MinusOk%   whether negation is allowed (0 if no)
  2112. VAttr%     color/attribute to use (see CalcAttr)
  2113. -------
  2114. St&        dollar amount (in pennies)
  2115. St$        formatted dollar amount
  2116. ExitCode%  key used to exit (ASCII code if +, scan code if -)
  2117.  
  2118. Name  : DiskStat             (Disk Statistics)
  2119. Class : Disk
  2120. Level : DOS
  2121.  
  2122. DiskStat gives you statistics on the memory usage of a
  2123. specified disk drive: the total number of clusters, the number
  2124. of available or free clusters, the number of sectors per
  2125. cluster, and the number of bytes per sector.
  2126.  
  2127. From this information, you can determine how much total disk
  2128. space there is, how much space is left and how much is used,
  2129. the size of a cluster, et al.
  2130.  
  2131. A few formulas for you:
  2132.  
  2133.    ClusterSize% = BytesPerSec% * SecsPerClus%
  2134.    FreeSpace& = FreeClus& * ClusterSize%
  2135.    TotalSpace& = TotalClus& * ClusterSize%
  2136.    UsedSpace& = TotalSpace& - FreeSpace&
  2137.  
  2138. A "cluster" is the minimum amount of disk space that can be
  2139. allocated at a time.  A typical cluster size for a medium-sized
  2140. hard drive is 2048 bytes, which means that any file from 1-2048
  2141. bytes in length is actually taking up a full 2048 bytes on the
  2142. disk.  Large cluster sizes improve file access times but can
  2143. waste a lot of disk space.
  2144.  
  2145.    DiskStat Drive$, FreeClus&, TotalClus&, BytesPerSec%,
  2146.       SecsPerClus%
  2147.  
  2148. Drive$        letter of the drive to examine
  2149. -------
  2150. FreeClus&     number of free or available clusters
  2151. TotalClus&    total number of clusters
  2152. BytesPerSec%  bytes per sector
  2153. SecsPerClus%  sectors per cluster (-1 if bad drive, etc)
  2154.  
  2155. Name  : Dissolve             (Dissolve)
  2156. Class : Display
  2157. Level : Clone
  2158.  
  2159. Like CLS, but a bit more fancy, this routine provides an
  2160. interesting way to clear the screen.  See also FadeOut.
  2161.  
  2162. This routine may cause heavy flickering on some CGA displays.
  2163.  
  2164.    Dissolve VAttr%
  2165.  
  2166. VAttr%   color/attribute to which to clear (see CalcAttr)
  2167.  
  2168. Name  : DMPrint              (DOS Message Print)
  2169. Class : Display
  2170. Level : DOS
  2171.  
  2172. This routine is similar to PRINT, but goes through DOS output
  2173. services, which allows your program to support output
  2174. redirection, filters, CTTY and other handy things.  See
  2175. DOSInkey for a DOS input service.
  2176.  
  2177. Note that the use of DMPrint means that you should avoid using
  2178. BASIC display handling (CLS, INPUT, LINE INPUT, PRINT, LOCATE,
  2179. CSRLIN, POS, etc).  Instead, you should use ANSI escape
  2180. sequences to control the display.  This requires that an ANSI
  2181. driver (like ANSI.SYS, DVANSI.SYS, NANSI.SYS, or ZANSI.SYS) be
  2182. installed on your system.  See your DOS manual for details on
  2183. ANSI sequences, or grab the documentation on ANSI from one of
  2184. your friendly local BBSes.
  2185.  
  2186. It is -possible- to use BASIC display handling in conjunction
  2187. with DMPrint, but that tends to defeat the purpose of using
  2188. DMPrint in the first place.
  2189.  
  2190. Note that the DMPrint routine does not add a carriage
  2191. return/linefeed to the end of a string.  If you want that, add
  2192. CHR$(13) + CHR$(10) to the end of the string.
  2193.  
  2194.    DMPrint St$
  2195.  
  2196. St$    string to display
  2197.  
  2198. Name  : DOSClrEol            (DOS Clear to End Of Line)
  2199. Class : Display
  2200. Level : DOS
  2201.  
  2202. This routine clears from the cursor position to the end of the
  2203. row using DOS output functions.  It requires that ANSI.SYS or
  2204. another ANSI driver be installed.
  2205.  
  2206.    DOSClrEol
  2207.  
  2208. Name  : DOSCls               (DOS Clear Screen)
  2209. Class : Display
  2210. Level : DOS
  2211.  
  2212. This routine clears the screen using DOS output functions.  It
  2213. requires that ANSI.SYS or another ANSI driver be installed.
  2214.  
  2215.    DOSCls
  2216.  
  2217. Name  : DOSColor             (DOS Color)
  2218. Class : Display
  2219. Level : DOS
  2220.  
  2221. This routine sets the screen colors using DOS output
  2222. functions.  It requires that ANSI.SYS or another ANSI driver be
  2223. installed.
  2224.  
  2225.    DOSColor Fore%, Back%
  2226.  
  2227. Fore%    foreground color
  2228. Back%    background color
  2229.  
  2230. Name  : DOSErrM$             (DOS Error Message)
  2231. Class : Miscellaneous
  2232. Level : DOS
  2233.  
  2234. Of the many PBClone routines that return error codes, most
  2235. simply pass the code back from DOS without any processing.  You
  2236. can see what the codes mean by checking the chart in
  2237. PBClone.DOC, or it may be more convenient to use DOSErrM$
  2238. instead.  This routine returns a short text description of the
  2239. error in question.
  2240.  
  2241.    ErrMsg$ = DOSErrM$(ErrCode%)
  2242.  
  2243. ErrCode%     error code to translate
  2244. -------
  2245. ErrMsg$      brief explanation of the error
  2246.  
  2247. Name  : DOSInkey             (DOS INKEY$)
  2248. Class : Input
  2249. Level : DOS
  2250.  
  2251. This routine is similar to INKEY$, but goes through DOS input
  2252. services, which allows your program to support input
  2253. redirection, filters, CTTY and other handy things.  See DMPrint
  2254. for a DOS output service.  See also DOSInky$.
  2255.  
  2256.    DOSInkey CharCode%, CharType%
  2257.  
  2258. -------
  2259. CharType%    0 if no key, 1 if normal key, 2 if extended key
  2260. CharCode%    ASCII code if normal key, scan code if extended key
  2261.  
  2262. Name  : DOSInky$             (DOS INKEY$)
  2263. Class : Input
  2264. Level : DOS
  2265.  
  2266. This routine works just like INKEY$, but goes through DOS input
  2267. services, which allows your program to support input
  2268. redirection, filters, CTTY and other handy things.  See DMPrint
  2269. for a DOS output service.  See also DOSInkey.
  2270.  
  2271.    ky$ = DOSInky$
  2272.  
  2273. -------
  2274. ky$      key, if any was waiting (0-2 chars/key, like INKEY$)
  2275.  
  2276. Name  : DOSInt%              (DOS Interrupt)
  2277. Class : Miscellaneous
  2278. Level : DOS
  2279.  
  2280. This routine provides you with easy access to DOS functions via
  2281. INT 21H, the major DOS interrupt.  It works like the CALL
  2282. INTERRUPT routines provided with QuickBASIC but is easier to
  2283. use, at the expense of some flexibility.
  2284.  
  2285. CAUTION: This routine works directly with DOS, bypassing most
  2286. of BASIC's safety precautions.  Possible chaos may result if
  2287. you don't know what you're doing!  A few specific caveats:
  2288.  
  2289.    1) Do Not use this routine to exit your program or execute
  2290.       another.  BASIC needs to clean up after itself before
  2291.       these tasks, and bypassing its handling is liable to make
  2292.       the system unstable at best.
  2293.  
  2294.    2) If you expect to use a string or array as a buffer, make
  2295.       sure it is long enough to handle the maximum amount of
  2296.       information anticipated. Strings and arrays can move
  2297.       about in memory, so be sure to get their addresses Just
  2298.       Before using DOSInt%.
  2299.  
  2300. If you wish to specify BASIC's data segment for DS, you can
  2301. find out what that is using the DataSeg routine (q.v.).
  2302.  
  2303. Normally, the CarryFlag% will be set if there is an error, in
  2304. which case AX will return the error code.
  2305.  
  2306.    CarryFlag% = DOSInt%(AX%, BX%, CX%, DX%, DS%)
  2307.  
  2308. AX%         desired setting of the AX register
  2309. BX%         desired setting of the BX register
  2310. CX%         desired setting of the CX register
  2311. DX%         desired setting of the DX register
  2312. DS%         desired setting of the DS and ES registers
  2313. -------
  2314. AX%         returned setting of the AX register
  2315. BX%         returned setting of the BX register
  2316. CX%         returned setting of the CX register
  2317. DX%         returned setting of the DX register
  2318. DS%         returned setting of the DS and ES registers
  2319. CarryFlag%  returned carry flag (0 no error, else code in AX)
  2320.  
  2321. Name  : DOSLocate            (DOS Locate)
  2322. Class : Display
  2323. Level : DOS
  2324.  
  2325. This routine sets the cursor position using DOS output
  2326. functions.  It requires that ANSI.SYS or another ANSI driver be
  2327. installed.
  2328.  
  2329. Note that many ANSI drivers do not fully support EGA or VGA
  2330. modes in that they are limited to a maximum of 25 rows.
  2331.  
  2332.    DOSLocate Row%, Column%
  2333.  
  2334. Row%      row
  2335. Column%   column
  2336.  
  2337. Name  : DPutRec              (Direct-to-memory Put Record)
  2338. Class : String
  2339. Level : Clone
  2340.  
  2341. The DPutRec routine allows you to put a string into a specified
  2342. area of memory (numeric array, BIOS data area, display memory,
  2343. or whatever).  The string should be initialized to the desired
  2344. record length in advance.
  2345.  
  2346. This works somewhat like an array of fixed length strings or a
  2347. random file, treating memory as a contiguous series of records
  2348. of a specified length.
  2349.  
  2350.    DPutRec DSeg%, DOfs%, RecNr%, St$
  2351.  
  2352. DSeg%      segment of the array to write into
  2353. DOfs%      offset of the array to write into
  2354. RecNr%     record number (starting at 1)
  2355. St$        string to write.  Init to record length (see above).
  2356.  
  2357. Name  : DPutScreen           (Direct-from-memory Put Screen)
  2358. Class : Display
  2359. Level : Clone
  2360.  
  2361. This routine restores a portion of the display (which was saved
  2362. to an array by DGetScreen or GetScreen) to the screen.  Only
  2363. text modes are supported. If your program uses multiple display
  2364. pages, you can put the image onto any of those pages.  A
  2365. special "slow" mode is supported for the CGA, to prevent
  2366. flickering (a problem only with some CGAs).
  2367.  
  2368. The PutScreen routine works the same way as this, but has a
  2369. simpler calling convention.  Also, if you wish to restore the
  2370. entire screen, you may find ScrRest easier (see).
  2371.  
  2372.    DPutScreen DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2373.       Page%, Fast%
  2374.  
  2375. DSeg%      segment of the array from which to restore the image
  2376. DOfs%      offset of the array from which to restore the image
  2377. TRow%      top row of the desired screen area
  2378. LCol%      left column of the desired screen area
  2379. BRow%      bottom row of the desired screen area
  2380. RCol%      right column of the desired screen area
  2381. Page%      page on which to restore the display
  2382. Fast%      whether to use fast mode (0 no)
  2383.  
  2384. Name  : DPutSt               (Direct-to-memory Put String)
  2385. Class : String
  2386. Level : Clone
  2387.  
  2388. The DPutSt routine allows you to put a string into a specified
  2389. area of memory (numeric array, BIOS data area, display memory,
  2390. or whatever).
  2391.  
  2392. You may specify an additional offset from the initial location,
  2393. which itself is specified as a segment and an offset.  The
  2394. second offset begins with position 1.  The combined total of
  2395. the two offsets must be under 65,536 at the moment.  I'll
  2396. remove that restriction at a later time.  With normalized
  2397. segment and offset specifications, which is usually the case,
  2398. this allows you to specify a number from 1-65,521 for the
  2399. second offset.
  2400.  
  2401.    DPutSt DSeg%, DOfs%, Posn&, St$
  2402.  
  2403. DSeg%      segment of the array to write to
  2404. DOfs%      offset of the array to write to
  2405. Posn&      location relative to the start of the array
  2406. St$        string to write into memory
  2407.  
  2408. Name  : DRecDel              (Direct-to-memory Record Deletion)
  2409. Class : Array management
  2410. Level : Any
  2411.  
  2412. This routine allows you to delete an item from an array.  The
  2413. item may consist of one or more array elements.  The size of
  2414. the array isn't actually changed, but the array elements are
  2415. moved as if a deletion took place.
  2416.  
  2417.    DRecDel DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2418.  
  2419. DSeg%      segment of the array
  2420. DOfs%      offset of the array
  2421. RecNr%     record/element number (starting at 1)
  2422. RecLen%    record/element length in bytes
  2423. Records%   total number of records/elements in the array
  2424.  
  2425. Name  : DRecIns              (Direct-to-mem Record Insertion)
  2426. Class : Array management
  2427. Level : Any
  2428.  
  2429. This routine allows you to insert an item into an array.  The
  2430. item may consist of one or more array elements.  The size of
  2431. the array isn't actually changed, but the array elements are
  2432. moved as if an insertion took place.  You must of course make
  2433. sure that the array is DIMed large enough to handle this.
  2434.  
  2435.    DRecIns DSeg%, DOfs%, RecNr%, RecLen%, Records%
  2436.  
  2437. DSeg%      segment of the array
  2438. DOfs%      offset of the array
  2439. RecNr%     record/element number (starting at 1)
  2440. RecLen%    record/element length in bytes
  2441. Records%   total number of records/elements in the array
  2442.  
  2443. Name  : DRecolor             (Direct-to-memory Recolor)
  2444. Class : Display
  2445. Level : Any
  2446.  
  2447. The DRecolor routine changes all text in one color to another
  2448. color.  It works only in text modes.  The colors are specified
  2449. as attributes (see CalcAttr).
  2450.  
  2451. This routine does not necessarily work on the display itself.
  2452. Instead, it allows you to specify the memory location (segment
  2453. and offset) of the "screen", which may be an actual screen, a
  2454. saved screen in an array, a multitasker's virtual screen, etc.
  2455. Among other things, this makes it easy to work with two
  2456. displays at once: use a segment of &HB000 for the mono display
  2457. and &HB800 for the color display (the offset in each case is
  2458. zero).
  2459.  
  2460.    DRecolor DSeg%, DOfs%, OldAttr%, NewAttr%
  2461.  
  2462. DSeg%      segment of "screen" memory
  2463. DOfs%      offset of "screen" memory
  2464. OldAttr%   color to be changed
  2465. NewAttr%   color to which to change
  2466.  
  2467. Name  : DRecolorArea         (Direct-to-memory Recolor Area)
  2468. Class : Display
  2469. Level : Clone
  2470.  
  2471. The DRecolorArea routine changes a specified area of the screen
  2472. to a specified color.  It works only in text modes.  The color
  2473. is specified as an attribute (see CalcAttr).
  2474.  
  2475. One of the more common applications for this routine is marking
  2476. an area of the screen, e.g. menu highlight bars.
  2477.  
  2478.    DRecolorArea DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  2479.      VAttr4%
  2480.  
  2481. This routine does not necessarily work on the display itself.
  2482. Instead, it allows you to specify the memory location (segment
  2483. and offset) of the "screen", which may be an actual screen, a
  2484. saved screen in an array, a multitasker's virtual screen, etc.
  2485. Among other things, this makes it easy to work with two
  2486. displays at once: use a segment of &HB000 for the mono display
  2487. and &HB800 for the color display (the offset in each case is
  2488. zero).
  2489.  
  2490. DSeg%       segment of "screen" memory
  2491. DOfs%       offset of "screen" memory
  2492. TRow%       top row of area to recolor
  2493. LCol%       left column of area to recolor
  2494. BRow%       bottom row of area to recolor
  2495. RCol%       right column of area to recolor
  2496. VAttr%       desired color
  2497.  
  2498. Name  : DriveSpace&          (Drive Space free)
  2499. Class : Disk
  2500. Level : DOS
  2501.  
  2502. This routine tells you how many bytes are free on a specified
  2503. disk drive.
  2504.  
  2505.    BytesFree& = DriveSpace&(Drive$)
  2506.  
  2507. Drive$      letter of the drive to examine
  2508. -------
  2509. BytesFree&  free bytes on the specified drive, or -1 if error
  2510.  
  2511. Name  : DrvSpaceL            (Drive Space free as Long integer)
  2512. Class : Disk
  2513. Level : DOS
  2514.  
  2515. This routine tells you how many bytes are free on a specified
  2516. disk drive. See also DriveSpace, a function-type version of
  2517. this routine.
  2518.  
  2519.    DrvSpaceL Drive$, BytesFree&
  2520.  
  2521. Drive$      letter of the drive to examine
  2522. -------
  2523. BytesFree&  free bytes on the specified drive, or -1 if error
  2524.  
  2525. Name  : DrvType              (Drive Type)
  2526. Class : Disk
  2527. Level : DOS 3.1+
  2528.  
  2529. The DrvType routine tells you whether a specified drive is
  2530. fixed or removeable, and whether it is local or remote (network
  2531. drive).
  2532.  
  2533.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  2534.  
  2535. Drive$       letter of the drive to examine
  2536. -------
  2537. Removeable%  whether the disk can be removed (0 if no)
  2538. Remote%      whether this is a remote drive (0 if no)
  2539. ErrCode%     error code: 0 if none, else bad DOS version
  2540.  
  2541. Name  : DScrRest             (Direct-from-mem Screen Restore)
  2542. Class : Display
  2543. Level : Clone
  2544.  
  2545. The DScrRest routine restores a display that was saved using
  2546. ScrSave or a similar routine.  It only works in text modes.
  2547. See also ScrRest.
  2548.  
  2549.    DScrRest DSeg%, DOfs%, Page%, Fast%
  2550.  
  2551. DSeg%      segment of info to restore to the screen
  2552. DOfs%      offset of info to restore to the screen
  2553. Page%      page on which to restore the display
  2554. Fast%      whether to use fast mode (0 no)
  2555.  
  2556. Name  : DScrSave             (Direct-from-memory Screen Save)
  2557. Class : Display
  2558. Level : Clone
  2559.  
  2560. The DScrSave routine saves the display to an array or other
  2561. storage area. Only text modes are supported.  For an 80x25
  2562. display, the array must hold 4,000 bytes (4,000 string
  2563. characters or 2,000 integers).  See also ScrSave.
  2564.  
  2565.    DScrSave DSeg%, DOfs%, Page%, Fast%
  2566.  
  2567. DSeg%      segment of place to store the display
  2568. DOfs%      offset of place to store the display
  2569. Page%      page from which to get the display
  2570. Fast%      whether to use fast mode (0 no)
  2571.  
  2572. Name  : DTR                  (Data Terminal Ready signal)
  2573. Class : Serial
  2574. Level : Clone
  2575.  
  2576. Just as IBM provided the standard for personal computers, Hayes
  2577. provided the standard for modem commands.  Unfortunately, the
  2578. command method of dropping carrier (hanging up the phone) was
  2579. badly designed, and all Hayes-compatible modems have a hard
  2580. time recognizing that command under certain line conditions.
  2581.  
  2582. Fortunately, there's a more reliable way of hanging up: the DTR
  2583. serial signal.  Turning this signal off will cause the modem to
  2584. hang up very quickly.  Most Hayes-compatible modems are
  2585. factory-set to pay attention to the DTR; those that aren't can
  2586. be made to do so either by flipping a hardware switch or with a
  2587. special initialization command.  See your modem manual for
  2588. details.
  2589.  
  2590. BASIC will drop the DTR when you CLOSE the comm port, but this
  2591. isn't always a convenient way to do it.  As a matter of fact,
  2592. this can be a decided nuisance, so many people have patched
  2593. their version of BASIC to avoid it.  If you would like to do
  2594. so, check your local BBS for the method!  With the PBClone DTR
  2595. routine, you can get full control over the DTR without having
  2596. to CLOSE the comm port.
  2597.  
  2598. Note: it may be wise to include a brief delay after dropping
  2599. the DTR, to give the modem a chance to react.  Try Delay18th
  2600. (see) with a wait of around 4.
  2601.  
  2602.    DTR CommPort%, TurnOn%
  2603.  
  2604. CommPort%    serial port (1-4, though BASIC only handles 1-2)
  2605. TurnOn%      whether to raise (turn on) the DTR (0 if no)
  2606.  
  2607. Name  : DupeVar              (Duplicate Variable)
  2608. Class : Miscellaneous
  2609. Level : Any
  2610.  
  2611. This routine allows you to copy the contents of one variable
  2612. into another, even if the variables are not of the same type.
  2613. You may specify any variable type EXCEPT variable-length
  2614. strings: integer, long integer, single, double, fixed-length
  2615. string, TYPEd variable, etc.
  2616.  
  2617. Most languages that provide TYPEd variables also provide for
  2618. variant records, that is, more than one way of looking at the
  2619. same information.  Curiously, BASIC doesn't.  This routine
  2620. allows you to map one variable into another, essentially
  2621. providing the lacking capability.
  2622.  
  2623. The only caveat for DupeVar is that both variables must be the
  2624. same length in bytes.
  2625.  
  2626.    DupeVar FromVar, ToVar
  2627.  
  2628. FromVar     variable from which to copy
  2629. -------
  2630. ToVar       variable to which to copy
  2631.  
  2632. Name  : DWindowMan2          (Direct-to-memory Window Manager)
  2633. Class : Display
  2634. Level : Any
  2635.  
  2636. This routine is identical to DWindowManager but for the fact
  2637. that it allows you to design your own custom window frames.
  2638. Please see the description of DWindowManager for general
  2639. information.
  2640.  
  2641. These are the additional frame types:
  2642.     6   custom frame composed of a single character
  2643.     7   custom frame composed of the specified 7-character list:
  2644.         top left corner, top middle, top right corner,
  2645.         left middle, right middle,
  2646.         bottom left corner, bottom middle, bottom right corner
  2647.  
  2648.  /------------------------------------------------------------\
  2649.  | A custom frame like this would be defined as frame type 7, |
  2650.  | with a frame string of "/-\||\-/", for instance.           |
  2651.  \------------------------------------------------------------/
  2652.  
  2653.  *************************************************
  2654.  * On the other hand, a frame like this would be *
  2655.  * frame type 6, with a frame string of "*".     *
  2656.  *************************************************
  2657.  
  2658. Note that this routine differs from the ProBas equivalent in
  2659. that it supports full frame definitions through frame type 7
  2660. (ProBas only supports type 6). The other differences mentioned
  2661. under WindowManager are also relevant.
  2662.  
  2663.    DWindowMan2 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2664.       Frame%, FSt$, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  2665.  
  2666. DSeg%       segment of "screen" memory
  2667. DOfs%       offset of "screen" memory
  2668. TRow%       top row of window
  2669. LCol%       left column of window
  2670. BRow%       bottom row of window
  2671. RCol%       right column of window
  2672. Frame%      frame type (see above)
  2673. FSt$        frame definition string (see above)
  2674. Fore%       frame foreground color
  2675. Back%       frame background color
  2676. Grow%       window growing option (see above)
  2677. Shade%      window shadow option (see above)
  2678. TFore%      title foreground color
  2679. Title$      window title ("" if none)
  2680.  
  2681. Name  : DWindowMan3          (Direct-to-memory Window Manager)
  2682. Class : Display
  2683. Level : Any
  2684.  
  2685. This routine is identical in function to DWindowManager.  The
  2686. parameters are mostly passed as an array, however, instead of
  2687. one by one.  Please see the description of DWindowManager for
  2688. general information.
  2689.  
  2690.    DWindowMan3 Parm%(), Title$
  2691.  
  2692. DSeg%       segment of "screen" memory
  2693. DOfs%       offset of "screen" memory
  2694. Parm%(1)    top row of window
  2695. Parm%(2)    left column of window
  2696. Parm%(3)    bottom row of window
  2697. Parm%(4)    right column of window
  2698. Parm%(5)    frame type (see above)
  2699. Parm%(6)    frame foreground color
  2700. Parm%(7)    frame background color
  2701. Parm%(8)    window growing option (see above)
  2702. Parm%(9)    window shadow option (see above)
  2703. Parm%(10)   title foreground color
  2704. Title$      window title ("" if none)
  2705.  
  2706. Name  : DWindowMan4          (Direct-to-memory Window Manager)
  2707. Class : Display
  2708. Level : Any
  2709.  
  2710. This is an extremely cut-down version of DWindowManager,
  2711. providing no more than a simple frame generator.
  2712.  
  2713. These are the available frame types:
  2714.     0   no frame
  2715.     1   single lines
  2716.     2   double lines
  2717.     3   single horizontal, double vertical lines
  2718.     4   double horizontal, single vertical lines
  2719.     5   block graphic lines
  2720.  
  2721. Note that this routine is different from its ProBas equivalent
  2722. in that a new frame type (5) is available.
  2723.  
  2724.    DWindowMan4 DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%, _
  2725.       Frame%, VAttr%
  2726.  
  2727. DSeg%       segment of "screen" memory
  2728. DOfs%       offset of "screen" memory
  2729. TRow%       top row of window
  2730. LCol%       left column of window
  2731. BRow%       bottom row of window
  2732. RCol%       right column of window
  2733. Frame%      frame type (see above)
  2734. VAttr%      frame color/attribute (use CalcAttr)
  2735.  
  2736. Name  : DWindowManager       (Direct-to-memory Window Manager)
  2737. Class : Display
  2738. Level : Any
  2739.  
  2740. DWindowManager displays a pop-up window according to your
  2741. specifications. The window may have any of a variety of frames,
  2742. a title, or a shadow, and it may appear instantly or "grow"
  2743. onto the screen.
  2744.  
  2745. These are the available frame types:
  2746.     0   no frame
  2747.     1   single lines
  2748.     2   double lines
  2749.     3   single horizontal, double vertical lines
  2750.     4   double horizontal, single vertical lines
  2751.     5   block graphic lines
  2752.  
  2753. These are the available shadows:
  2754.    -3   transparent shadow on the right
  2755.    -2   transparent shadow on the left
  2756.    -1   solid black shadow on the left
  2757.     0   no shadow
  2758.    1+   shadow attribute (use CalcAttr) for a colored shadow
  2759.  
  2760. Options for growing windows are as follows:
  2761.    -1   grow as fast as possible
  2762.     0   pop onto the screen
  2763.    1+   grow with delay given in milliseconds (15 works for me)
  2764.  
  2765. Note that this routine is different from its ProBas equivalent
  2766. in a number of respects.  The grow delay time is different.
  2767. Growing is done more smoothly. The shadow and title parameters
  2768. are not changed by this routine.  A new frame type (5) was
  2769. added.  If a title is too long, it is truncated instead of
  2770. being ignored completely.  Using a -1 as the title foreground
  2771. color will not turn off the title; instead, use a null title
  2772. string.
  2773.  
  2774.    DWindowManager DSeg%, DOfs%, TRow%, LCol%, BRow%, RCol%,
  2775.       Frame%, Fore%, Back%, Grow%, Shade%, TFore%, Title$
  2776.  
  2777. This routine does not necessarily work on the display itself.
  2778. Instead, it allows you to specify the memory location (segment
  2779. and offset) of the "screen", which may be an actual screen, a
  2780. saved screen in an array, a multitasker's virtual screen, etc.
  2781. Among other things, this makes it easy to work with two
  2782. displays at once: use a segment of &HB000 for the mono display
  2783. and &HB800 for the color display (the offset in each case is
  2784. zero).
  2785.  
  2786. DSeg%       segment of "screen" memory
  2787. DOfs%       offset of "screen" memory
  2788. TRow%       top row of window
  2789. LCol%       left column of window
  2790. BRow%       bottom row of window
  2791. RCol%       right column of window
  2792. Frame%      frame type (see above)
  2793. Fore%       frame foreground color
  2794. Back%       frame background color
  2795. Grow%       window growing option (see above)
  2796. Shade%      window shadow option (see above)
  2797. TFore%      title foreground color
  2798. Title$      window title ("" if none)
  2799.  
  2800. Name  : DXQPrint             (Direct Extended Quick Print)
  2801. Class : Display
  2802. Level : Any
  2803.  
  2804. This routine provides a rather crude, but very fast, display
  2805. capability.  It works like the PRINT statement in BASIC, except
  2806. that it doesn't move the cursor or process control codes.  It
  2807. works only in text modes.
  2808.  
  2809. This routine does not necessarily work on the display itself.
  2810. Instead, it allows you to specify the memory location (segment
  2811. and offset) of the "screen", which may be an actual screen, a
  2812. saved screen in an array, a multitasker's virtual screen, etc.
  2813. Among other things, this makes it easy to work with two
  2814. displays at once: use a segment of &HB000 for the mono display
  2815. and &HB800 for the color display (the offset in each case is
  2816. zero).
  2817.  
  2818.    DXQPrint DSeg%, DOfs%, St$, Row%, Column%, VAttr%
  2819.  
  2820. DSeg%     segment of "screen" memory
  2821. DOfs%     offset of "screen" memory
  2822. St$       string to display
  2823. Row%      starting row
  2824. Column%   starting column
  2825. VAttr%    color/attribute (see CalcAttr)
  2826.  
  2827. Name  : EGARest7             (EGA Restore for SCREEN 7)
  2828. Class : Display
  2829. Level : Clone
  2830.  
  2831. This routine allows you to restore a SCREEN 7 (EGA, 320x200, 16
  2832. color) display that was saved using EGASave7 (see).
  2833.  
  2834.    EGARest7 DSeg%, DOfs%
  2835.  
  2836. DSeg%        segment of storage array, returned by VARSEG
  2837. DOfs%        offset  of storage array, returned by VARPTR
  2838.  
  2839. Name  : EGARest8             (EGA Restore for SCREEN 8)
  2840. Class : Display
  2841. Level : Clone
  2842.  
  2843. This routine allows you to restore a SCREEN 8 (EGA, 640x200, 16
  2844. color) display that was saved using EGASave8 (see).
  2845.  
  2846.    EGARest8 DSeg%, DOfs%
  2847.  
  2848. DSeg%        segment of storage array, returned by VARSEG
  2849. DOfs%        offset  of storage array, returned by VARPTR
  2850.  
  2851. Name  : EGARest9             (EGA Restore for SCREEN 9)
  2852. Class : Display
  2853. Level : Clone
  2854.  
  2855. This routine allows you to restore a SCREEN 9 (EGA, 640x350, 16
  2856. color) display that was saved using EGASave9 (see).
  2857.  
  2858.    EGARest9 DSeg1%, DOfs1%, DSeg2%, DOfs2%
  2859.  
  2860. DSeg1%       segment of storage array #1, returned by VARSEG
  2861. DOfs1%       offset  of storage array #1, returned by VARPTR
  2862. DSeg2%       segment of storage array #2, returned by VARSEG
  2863. DOfs2%       offset  of storage array #2, returned by VARPTR
  2864.  
  2865. Name  : EGASave7             (EGA Save for SCREEN 7)
  2866. Class : Display
  2867. Level : Clone
  2868.  
  2869. This routine allows you to save a SCREEN 7 (EGA, 320x200, 16
  2870. color) display that can be restored using EGARest7 (see).
  2871.  
  2872. The array used to hold the screen must contain 32,000 bytes.
  2873. For an integer array, this means that you must create the array
  2874. by DIM Array%(1 TO 16000).
  2875.  
  2876.    EGASave7 DSeg%, DOfs%
  2877.  
  2878. DSeg%        segment of storage array, returned by VARSEG
  2879. DOfs%        offset  of storage array, returned by VARPTR
  2880.  
  2881. Name  : EGASave8             (EGA Save for SCREEN 8)
  2882. Class : Display
  2883. Level : Clone
  2884.  
  2885. This routine allows you to save a SCREEN 8 (EGA, 640x200, 16
  2886. color) display that can be restored using EGARest8 (see).
  2887.  
  2888. The array used to hold the screen must contain 64,000 bytes.
  2889. For an integer array, this means that you must create the array
  2890. by DIM Array%(1 TO 32000).
  2891.  
  2892.    EGASave8 DSeg%, DOfs%
  2893.  
  2894. DSeg%        segment of storage array, returned by VARSEG
  2895. DOfs%        offset  of storage array, returned by VARPTR
  2896.  
  2897. Name  : EGASave9             (EGA Save for SCREEN 9)
  2898. Class : Display
  2899. Level : Clone
  2900.  
  2901. This routine allows you to save a SCREEN 9 (EGA, 640x350, 16
  2902. color) display that can be restored using EGARest9 (see).
  2903.  
  2904. Two arrays must be used to hold the screen, for a total of
  2905. 112,000 bytes.  If you use integer arrays, each array must be
  2906. created by DIM Array%(1 TO 28000).
  2907.  
  2908.    EGASave9 DSeg%, DOfs%
  2909.  
  2910. DSeg1%       segment of storage array #1, returned by VARSEG
  2911. DOfs1%       offset  of storage array #1, returned by VARPTR
  2912. DSeg2%       segment of storage array #2, returned by VARSEG
  2913. DOfs2%       offset  of storage array #2, returned by VARPTR
  2914.  
  2915. Name  : Elapsed              (Elapsed time)
  2916. Class : Time
  2917. Level : Any
  2918.  
  2919. This routine tells you the amount of time elapsed between a
  2920. given starting time and ending time.  The difference between
  2921. the times must be less than 24 hours for the results to be
  2922. meaningful.
  2923.  
  2924. See also ElapsedTime, the FUNCTION version of this routine.
  2925.  
  2926.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  2927.  
  2928. TimeStart$   starting time
  2929. TimeStop$    ending time
  2930. -------
  2931. TimeDiff$    elapsed time
  2932.  
  2933. Name  : ElapsedTime$         (Elapsed time)
  2934. Class : Time
  2935. Level : Any
  2936.  
  2937. This routine tells you the amount of time elapsed between a
  2938. given starting time and ending time.  The difference between
  2939. the times must be less than 24 hours for the results to be
  2940. meaningful.
  2941.  
  2942. See also Elapsed, the SUB version of this routine.
  2943.  
  2944.    TimeDiff$ = ElapsedTime$(TimeStart$, TimeStop$)
  2945.  
  2946. TimeStart$   starting time
  2947. TimeStop$    ending time
  2948. -------
  2949. TimeDiff$    elapsed time
  2950.  
  2951. Name  : EMSBuffer            (EMS Buffer size)
  2952. Class : Memory
  2953. Level : BIOS
  2954.  
  2955. EMSBuffer tells you how many bytes are needed to save the state
  2956. of the EMS array routines.  Used in conjunction with EMSSave
  2957. and EMSRest, it allows you to preserve EMS arrays across a
  2958. CHAIN to another part of your program.
  2959.  
  2960.    EMSBuffer Bytes%
  2961.    EMSState$ = SPACE$(Bytes%)
  2962.    EMSSave EMSState$
  2963.  
  2964. -------
  2965. Bytes%       bytes needed to save EMS array state
  2966.  
  2967. Name  : EMSClose             (EMS Close)
  2968. Class : Memory
  2969. Level : BIOS
  2970.  
  2971. The EMSClose routine is used when you are finished with an EMS
  2972. array.  It frees the array handle and EMS memory for other
  2973. uses.  If you don't close all EMS arrays before your program
  2974. ends, the memory will be lost until the system is rebooted, so
  2975. it is important to remember EMSClose.
  2976.  
  2977.    EMSClose ArrayHandle%
  2978.  
  2979. ArrayHandle%    handle of an EMS array
  2980.  
  2981. Name  : EMSGet               (EMS Get)
  2982. Class : Memory
  2983. Level : BIOS
  2984.  
  2985. This routine gets an element from an EMS array created by
  2986. EMSOpen.  Element numbers start at 0.  Be sure to use the right
  2987. numeric type for the array-- for instance, if you opened the
  2988. array for SINGLE precision, use "Value!".
  2989.  
  2990.    EMSGet ArrayHandle%, ElementNr&, Value
  2991.  
  2992. ArrayHandle%    handle of an EMS array
  2993. ElementNr&      element number to get
  2994. -------
  2995. Value           result (must be correct type for array)
  2996.  
  2997. Name  : EMSOpen              (EMS Open)
  2998. Class : Memory
  2999. Level : BIOS
  3000.  
  3001. This routine allows you to open a block of EMS (expanded)
  3002. memory which can then be accessed like a numeric array.  The
  3003. array size is limited only by available EMS memory (use GetLIMM
  3004. to find out how much is available).  You may specify any
  3005. numeric type:
  3006.  
  3007.     1   INTEGER
  3008.     2   LONG or SINGLE
  3009.     3   DOUBLE
  3010.  
  3011. When the array is opened, you are returned an "array handle"
  3012. which is used to access that array.  Access to the array is
  3013. done via EMSGet and EMSPut.  When you are finished with the
  3014. array, you must close it with EMSClose.
  3015.  
  3016. As many as 25 EMS arrays can be in use at one time, subject to
  3017. limitations which may be imposed by your EMS driver (each array
  3018. requires one EMS handle).
  3019.  
  3020.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  3021.  
  3022. Elements&       number of elements in array (like DIM size)
  3023. ElementType%    numeric type of array (see above)
  3024. -------
  3025. ArrayHandle%    handle of an EMS array
  3026. ErrCode%        whether an error occurred (0 no)
  3027.  
  3028. Name  : EMSPut               (EMS Put)
  3029. Class : Memory
  3030. Level : BIOS
  3031.  
  3032. This routine puts an element into an EMS array created by
  3033. EMSOpen.  Element numbers start at 0.  Be sure to use the right
  3034. numeric type for the array-- for instance, if you opened the
  3035. array for SINGLE precision, use "Value!".
  3036.  
  3037.    EMSPut ArrayHandle%, ElementNr&, Value
  3038.  
  3039. ArrayHandle%    handle of an EMS array
  3040. ElementNr&      element number to set
  3041. Value           value to store (must be correct type for array)
  3042.  
  3043. Name  : EMSRest              (EMS Restore state)
  3044. Class : Memory
  3045. Level : BIOS
  3046.  
  3047. This routine allows you to restore the state of the EMS array
  3048. handler.  Used in conjunction with EMSBuffer and EMSSave, it
  3049. allows you to preserve EMS arrays across a CHAIN to another
  3050. part of your program.
  3051.  
  3052.    EMSRest EMSState$
  3053.  
  3054. EMSState$    saved EMS array state
  3055.  
  3056. Name  : EMSSave              (EMS Save state)
  3057. Class : Memory
  3058. Level : BIOS
  3059.  
  3060. This routine allows you to save the state of the EMS array
  3061. handler.  Used in conjunction with EMSBuffer and EMSRest, it
  3062. allows you to preserve EMS arrays across a CHAIN to another
  3063. part of your program.
  3064.  
  3065.    EMSBuffer Bytes%
  3066.    EMSState$ = SPACE$(Bytes%)
  3067.    EMSSave EMSState$
  3068.  
  3069. -------
  3070. EMSState$    saved EMS array state
  3071.  
  3072. Name  : EnhKbd               (Enhanced Keyboard)
  3073. Class : Input
  3074. Level : BIOS
  3075.  
  3076. By default, the PBClone routines assume an old-style keyboard
  3077. is in use, for greatest compatibility.  EnhKbd allows you to
  3078. turn on enhanced keyboard handling for the current generation
  3079. of (usually) 101-key keyboards.  This allows access to the F11
  3080. and F12 function keys as well as codes for key combinations
  3081. that used to be ignored, among other things.
  3082.  
  3083. The KbdType or KbdType2% routine can be used to determine if an
  3084. enhanced keyboard is available (recommended).
  3085.  
  3086. Note that EnhKbd works by intercepting the BIOS keyboard
  3087. handler.  All calls to the BIOS keyboard interrupt are
  3088. converted from the old keyboard functions to the new ones.  YOU
  3089. MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can restore
  3090. the old setup.  Otherwise, the computer will most probably
  3091. crash.
  3092.  
  3093. A list of the new key codes is given in PBClone.DOC.
  3094.  
  3095.    EnhKbd Enable%
  3096.  
  3097. Enable%     turn on enhanced keyboard support (0 disable)
  3098.  
  3099. Name  : Equipment            (Equipment information)
  3100. Class : Equipment
  3101. Level : BIOS
  3102.  
  3103. This routine gives you some information about the basic
  3104. equipment in your computer.  Note that the "game port"
  3105. information is not reliable, due to changes in the meaning of
  3106. this particular area of the BIOS over many years.
  3107.  
  3108.    Equipment Memory%, Parallel%, Serial%, Game%
  3109.  
  3110. -------
  3111. Memory%    kilobytes of conventional memory installed (16 - 640)
  3112. Parallel%  parallel (printer) ports installed (0-4)
  3113. Serial%    serial (communications) ports installed (0-4)
  3114. Game%      game (joystick) ports installed (0-1).  See remarks, above.
  3115.  
  3116. Name  : EuropeDate           (European Date format)
  3117. Class : Time
  3118. Level : Any
  3119.  
  3120. This routine takes a date in one of the American formats
  3121. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  3122. convention ("DD.MM.YY" or "DD.MM.YYYY").  The date is formatted
  3123. according to a format string which provides the desired
  3124. delimiter and year length, e.g. "##-##-##" specifies a
  3125. delimiter of "-" and a year length of two digits.
  3126.  
  3127. An error code is returned if the date is not valid.
  3128.  
  3129.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  3130.  
  3131. DateSt$     date to format (month, day, year order)
  3132. Format$     format for the date
  3133. -------
  3134. Result$     resulting date (day, month, year order)
  3135. ErrCode     whether the date is valid (0 ok)
  3136.  
  3137. Name  : EWindowManagerC      (EGA Window Manager w Char coords)
  3138. Class : Display
  3139. Level : Clone
  3140.  
  3141. EWindowManagerC displays a pop-up window according to your
  3142. specifications. The window may have any of a variety of frames,
  3143. a title, or a shadow, and it may appear instantly or "grow"
  3144. onto the screen.  EGA and VGA graphics modes (SCREEN 7 through
  3145. SCREEN 12) are supported.
  3146.  
  3147. These are the available frame types:
  3148.     0   no frame
  3149.     1   single lines
  3150.     2   double lines
  3151.     3   single horizontal, double vertical lines
  3152.     4   double horizontal, single vertical lines
  3153.     5   block graphic lines
  3154.  
  3155. These are the available shadows:
  3156.     0   no shadow
  3157.    1+   shadow attribute (use CalcAttr) for a colored shadow
  3158.  
  3159. Options for growing windows are as follows:
  3160.    -1   grow as fast as possible
  3161.     0   pop onto the screen
  3162.    1+   grow with delay given in milliseconds (not recommended)
  3163.  
  3164. The differences between this routine and its ProBas equivalent
  3165. are the same as mentioned in the description for
  3166. WindowManager.  In addition, growing windows are supported, but
  3167. are not recommended (too slow).  Colored shadows work as in
  3168. WindowManager.  "True" shadows are not yet supported.
  3169.  
  3170.    EWindowManagerC TRow%, LCol%, BRow%, RCol%, Frame%,
  3171.       Fore%, Back%, Grow%, Shade%, S1%, S2%, TFore%, Title$
  3172.  
  3173. TRow%       top row of window
  3174. LCol%       left column of window
  3175. BRow%       bottom row of window
  3176. RCol%       right column of window
  3177. Frame%      frame type (see above)
  3178. Fore%       frame foreground color
  3179. Back%       frame background color
  3180. Grow%       window growing option (see above)
  3181. Shade%      window shadow option (see above)
  3182. S1%         unused
  3183. S2%         unused
  3184. TFore%      title foreground color
  3185. Title$      window title ("" if none)
  3186.  
  3187. Name  : Exist                (file Existence)
  3188. Class : Disk
  3189. Level : DOS
  3190.  
  3191. Most versions of BASIC give you no way of seeing if a file
  3192. exists before you try to OPEN it, so you end up taking your
  3193. chances.  The Exist routine allows you to test to see if the
  3194. file exists beforehand.  It isn't really necessary for the
  3195. PBClone file routines, which will return an appropriate error
  3196. code, but it's an important safeguard when using the BASIC OPEN
  3197. statement.
  3198.  
  3199. The Exist routine does not support wildcards.  If you need that
  3200. feature, try the FindFirstFx and FindNextFx routines instead.
  3201.  
  3202. See also Exist2, the FUNCTION version of this routine.
  3203.  
  3204.    Exist FileName$, Found%
  3205.  
  3206. FileName$   name of the file to look for
  3207. -------
  3208. Found%      whether the file was found (0 if no)
  3209.  
  3210. Name  : Exist2%              (file Existence)
  3211. Class : Disk
  3212. Level : DOS
  3213.  
  3214. Most versions of BASIC give you no way of seeing if a file
  3215. exists before you try to OPEN it, so you end up taking your
  3216. chances.  The Exist2% function allows you to test to see if the
  3217. file exists beforehand.  It isn't really necessary for the
  3218. PBClone file routines, which will return an appropriate error
  3219. code, but it's an important safeguard when using the OPEN
  3220. statement.
  3221.  
  3222. The Exist2% routine does not support wildcards.  If you need
  3223. that feature, try the FindFirstFx and FindNextFx routines
  3224. instead.
  3225.  
  3226. See also Exist, the SUB version of this routine.
  3227.  
  3228.    Found% = Exist2%(FileName$)
  3229.  
  3230. FileName$   name of the file to look for
  3231. -------
  3232. Found%      whether the file was found (0 if no)
  3233.  
  3234. Name  : ExplainFAttr$        (Explain File Attribute)
  3235. Class : Disk
  3236. Level : Any
  3237.  
  3238. This function returns a string explaining what a file attribute
  3239. means, using a specified level of abbreviation.  A single space
  3240. is used between each word, e.g. a hidden subdirectory at
  3241. abbreviation level 2 would be "Hid Dir".
  3242.  
  3243. Abbreviation Levels:
  3244.         1           2              3
  3245.    ---------------------------------------
  3246.  1      R          R-O         Read-Only
  3247.  2      H          Hid         Hidden
  3248.  4      S          Sys         System
  3249.  8      V          Vol         Volume
  3250. 16      D          Dir         Directory
  3251. 32      A          Arc         Archive
  3252.  
  3253. This function is convenient in conjunction with any of the
  3254. routines which return a file attribute: GetAttrF, GetAttrFx,
  3255. GetFAttr, LoadDirAll.
  3256.  
  3257.    Info$ = ExplainFAttr$(FilAttr%, AbbrevLevel%)
  3258.  
  3259. We use FilAttr% instead of FileAttr%, since BASIC has a
  3260. built-in FILEATTR function.
  3261.  
  3262. FilAttr%      file attribute
  3263. -------
  3264. AbbrevLevel%  how much to abbreviate the result (1-3)
  3265.  
  3266. Name  : EXQPrintC            (EGA Extended Quick Print, Char)
  3267. Class : Display
  3268. Level : Clone
  3269.  
  3270. This routine provides a rather crude, but very fast, display
  3271. capability.  It works like the PRINT statement in BASIC, except
  3272. that it doesn't move the cursor or process control codes.  It
  3273. works in EGA and VGA graphics modes (SCREEN 7 through SCREEN
  3274. 12).
  3275.  
  3276.    EXQPrintC St$, Row%, Column%, Fore%, Back%
  3277.  
  3278. St$       string to display
  3279. Row%      starting row
  3280. Column%   starting column
  3281. Fore%     foreground color
  3282. Back%     background color
  3283.  
  3284. Name  : ExtendFSpec          (Extend File Specification)
  3285. Class : Disk
  3286. Level : DOS
  3287.  
  3288. The ExtendFSpec routine combines a number of handy services
  3289. together.  It is intended for processing user-entered file
  3290. specifications.  It does the following:
  3291.  
  3292.    1) Makes sure the filespec is valid
  3293.    2) Formats the filespec to normal DOS standards
  3294.    3) Tells you whether the drive and subdirectories
  3295.       specified exist
  3296.    4) Fills out any drive or subdirectory information that
  3297.       was left out (optionally includes adding an extension
  3298.       to files which lack one)
  3299.  
  3300. The error codes returned are as follows:
  3301.    -1    Invalid file specification
  3302.     0    No error
  3303.     1    Specified drive does not exist (warning only)
  3304.     2    Specified subdirectory does not exist (warning only)
  3305.  
  3306. The ExtendFSpec routine mimics DOS filename handling exactly,
  3307. to the best of my knowledge.
  3308.  
  3309.    ExtendFSpec File$, Ext$, FullFile$, ErrCode%
  3310.  
  3311. File$      file specification to process
  3312. Ext$       extension to add to files that don't have extensions
  3313. -------
  3314. FullFile$  processed file specification
  3315. ErrCode%   error code
  3316.  
  3317. Name  : ExtGet               (Extended memory Get)
  3318. Class : Memory
  3319. Level : BIOS (AT)
  3320.  
  3321. This routine allows you to get information from extended
  3322. memory.  It should only be used on AT-class computers, since
  3323. older PCs do not support extended memory.
  3324.  
  3325. You may get up to 32,766 words (just under 64 kilobytes) at a
  3326. time from a specified location in extended memory.  The
  3327. location is specified as the distance from the start of
  3328. extended memory, starting at 1 for the first location.  One
  3329. word is equivalent to one integer.
  3330.  
  3331. See ExtMem for information on extended memory constraints.
  3332.  
  3333.    ExtGet DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3334.  
  3335. DSeg%       segment of array to place data from extended memory
  3336. DOfs%       offset of array to place data from extended memory
  3337. Posn&       location of data in extended memory (starting at 1)
  3338. Words%      # of words to transfer (1 int = 1 word = 2 byte)
  3339. -------
  3340. ErrCode%    error code (0 if no error)
  3341.  
  3342. Name  : ExtMem               (Extended Memory)
  3343. Class : Memory / Equipment
  3344. Level : BIOS (AT)
  3345.  
  3346. This routine allows you to find out how much extended memory is
  3347. available. It should only be used on AT-class computers, since
  3348. older PCs do not support extended memory.
  3349.  
  3350. The amount of memory returned may be either the total amount of
  3351. extended memory installed or just the amount available at this
  3352. time, depending on how previously-installed programs (if any)
  3353. make use of extended memory. Unfortunately, there is no
  3354. standard which defines how a program should use extended memory
  3355. as there is with EMS (expanded memory), so there is no way for
  3356. a program to determine whether or how another program is using
  3357. extended memory.  Microsoft is trying to clear up this
  3358. situation with its HIMEM driver (available at your local BBS,
  3359. or [last I looked] free from Microsoft), but this approach
  3360. hasn't really become standard yet.
  3361.  
  3362.    ExtMem KBytes%
  3363.  
  3364. -------
  3365. KBytes%     the number of kilobytes of extended memory
  3366.  
  3367. Name  : ExtPut               (Extended memory Put)
  3368. Class : Memory
  3369. Level : BIOS (AT)
  3370.  
  3371. This routine allows you to put information into extended
  3372. memory.  It should only be used on AT-class computers, since
  3373. older PCs do not support extended memory.
  3374.  
  3375. You may put up to 32,766 words (just under 64 kilobytes) at a
  3376. time into a specified location in extended memory.  The
  3377. location is specified as the distance from the start of
  3378. extended memory, starting at 1 for the first location.  One
  3379. word is equivalent to one integer.
  3380.  
  3381. Note that you can't rely on extended memory being available
  3382. just because it exists.  There is no automatic way to determine
  3383. if another program is also trying to use the same extended
  3384. memory.  If in doubt, allow a user-installed option to
  3385. enable/disable the use of extended memory by your program.
  3386.  
  3387.    ExtPut DSeg%, DOfs%, Posn&, Words%, ErrCode%
  3388.  
  3389. DSeg%       segment of data to store in extended memory
  3390. DOfs%       offset of data to store in extended memory
  3391. Posn&       location to place data in extended memory
  3392. Words%      # of words to transfer (1 int = 1 word = 2 bytes)
  3393. -------
  3394. ErrCode%    error code (0 if no error)
  3395.  
  3396. Name  : Extract              (Extract delimited substring)
  3397. Class : String
  3398. Level : Any
  3399.  
  3400. Extract allows you to remove any one of a list of delimited
  3401. substrings in a string.  It's useful for input parsing and
  3402. database work.  You pass it the string, delimiter, and the
  3403. number of the desired substring (numbers start at one).  It
  3404. returns the starting position of the substring within the
  3405. string and the length of the substring (0 if not found).
  3406.  
  3407. Just for example, let's assume we have a string as follows:
  3408.    St$ = "Tom Hanlin=3544 E. Southern Ave #104=Mesa, AZ 85204"
  3409.  
  3410. If we selected a delimiter of "=" and substring number three,
  3411. the results would be "Mesa, AZ 85204".
  3412.  
  3413. Delimiters of more than one character are fine.  This can be
  3414. handy for locating carriage return/linefeed pairs, among other
  3415. things.
  3416.  
  3417.    Extract St$, Delimiter$, SubStrNr%, StartPosn%, SLen%
  3418.    SubSt$ = MID$(St$, StartPosn%, SLen%)
  3419.  
  3420. St$         string from which to extract
  3421. Delimiter$  delimiter between substrings
  3422. SubStrNr%   number of the desired substring
  3423. -------
  3424. StartPosn%  starting position of substring within the string
  3425. SLen%       length of the substring (0 if none)
  3426.  
  3427. Name  : FadeOut              (Fade Out)
  3428. Class : Display
  3429. Level : Clone
  3430.  
  3431. Like CLS, but a bit more fancy, this routine provides an
  3432. interesting way to clear the screen.  See also Dissolve.
  3433.  
  3434.    FadeOut VAttr%
  3435.  
  3436. VAttr%   color/attribute to which to clear (see CalcAttr)
  3437.  
  3438. Name  : FarPeek%             (Far memory Peek)
  3439. Class : Memory
  3440. Level : Clone
  3441.  
  3442. This is like the BASIC PEEK function, but expects both a
  3443. segment and an offset, thus doing away with the need for DEF
  3444. SEG.  This is especially handy for use in subprograms which
  3445. might otherwise inadvertently change the DEF SEG value expected
  3446. by the main program.
  3447.  
  3448.    Value% = FarPeek%(DSeg%, DOfs%)
  3449.  
  3450. Related routines include FarPeekI%, FarPeekL&, DGetSt, DGetRec.
  3451.  
  3452. DSeg%    segment of the location to look at
  3453. DOfs%    offset of the location to look at
  3454. -------
  3455. Value%   value at the specified memory location (byte: 0-255)
  3456.  
  3457. Name  : FarPeekI%            (Far memory Peek Integer)
  3458. Class : Memory
  3459. Level : Clone
  3460.  
  3461. This is like the BASIC PEEK function, but expects both a
  3462. segment and an offset, thus doing away with the need for DEF
  3463. SEG.  This is especially handy for use in subprograms which
  3464. might otherwise inadvertently change the DEF SEG value expected
  3465. by the main program.  Unlike PEEK, this routine returns a word
  3466. (integer) rather than a byte.
  3467.  
  3468.    Value% = FarPeekI%(DSeg%, DOfs%)
  3469.  
  3470. Related routines include FarPeek%, FarPeekL&, DGetSt, DGetRec.
  3471.  
  3472. DSeg%    segment of the location to look at
  3473. DOfs%    offset of the location to look at
  3474. -------
  3475. Value%   value at the specified memory location (word)
  3476.  
  3477. Name  : FarPeekL&            (Far memory Peek Long integer)
  3478. Class : Memory
  3479. Level : Clone
  3480.  
  3481. This is like the BASIC PEEK function, but expects both a
  3482. segment and an offset, thus doing away with the need for DEF
  3483. SEG.  This is especially handy for use in subprograms which
  3484. might otherwise inadvertently change the DEF SEG value expected
  3485. by the main program.  Unlike PEEK, this routine returns a dword
  3486. (long integer) rather than a byte.
  3487.  
  3488.    Value& = FarPeekL&(DSeg%, DOfs%)
  3489.  
  3490. Related routines include FarPeek%, FarPeekI%, DGetSt, DGetRec.
  3491.  
  3492. DSeg%    segment of the location to look at
  3493. DOfs%    offset of the location to look at
  3494. -------
  3495. Value&   value at the specified memory location (dword)
  3496.  
  3497. Name  : FarPoke              (Far memory Poke)
  3498. Class : Memory
  3499. Level : Clone
  3500.  
  3501. This is like the BASIC POKE statement, but expects both a
  3502. segment and an offset, thus doing away with the need for DEF
  3503. SEG.  This is especially handy for use in subprograms which
  3504. might otherwise inadvertently change the DEF SEG value expected
  3505. by the main program.
  3506.  
  3507.    FarPoke DSeg%, DOfs%, Value%
  3508.  
  3509. Related routines include FarPokeI, FarPokeL, DPutSt, DPutRec.
  3510.  
  3511. DSeg%    segment of the location to look at
  3512. DOfs%    offset of the location to look at
  3513. Value%   value to store in the given memory posn (byte: 0-255)
  3514.  
  3515. Name  : FarPokeI             (Far memory Poke Integer)
  3516. Class : Memory
  3517. Level : Clone
  3518.  
  3519. This is like the BASIC POKE statement, but expects both a
  3520. segment and an offset, thus doing away with the need for DEF
  3521. SEG.  This is especially handy for use in subprograms which
  3522. might otherwise inadvertently change the DEF SEG value expected
  3523. by the main program.  Unlike POKE, this routine stores a word
  3524. or integer.
  3525.  
  3526.    FarPokeI DSeg%, DOfs%, Value%
  3527.  
  3528. Related routines include FarPoke, FarPokeL, DPutSt, DPutRec.
  3529.  
  3530. DSeg%    segment of the location to look at
  3531. DOfs%    offset of the location to look at
  3532. Value%   value to store in the given memory posn (word)
  3533.  
  3534. Name  : FarPokeL             (Far memory Poke Long integer)
  3535. Class : Memory
  3536. Level : Clone
  3537.  
  3538. This is like the BASIC POKE statement, but expects both a
  3539. segment and an offset, thus doing away with the need for DEF
  3540. SEG.  This is especially handy for use in subprograms which
  3541. might otherwise inadvertently change the DEF SEG value expected
  3542. by the main program.  Unlike POKE, this routine stores a dword
  3543. or long integer.
  3544.  
  3545.    FarPokeL DSeg%, DOfs%, Value&
  3546.  
  3547. Related routines include FarPoke, FarPokeI, DPutSt, DPutRec.
  3548.  
  3549. DSeg%    segment of the location to look at
  3550. DOfs%    offset of the location to look at
  3551. Value&   value to store in the given memory posn (dword)
  3552.  
  3553. Name  : FClose1              (File Close)
  3554. Class : Disk
  3555. Level : DOS
  3556.  
  3557. This routine closes a file that was opened by FOpen1 or
  3558. FCreate.  It can also be used to close any of the predefined
  3559. device handles.
  3560.  
  3561. These are the predefined device handles that are always
  3562. available:
  3563.  
  3564.    0    CON     stdin     standard input, normally the keyboard
  3565.    1    CON     stdout    standard output, normally the display
  3566.    2    CON     stderr    standard error, almost always display
  3567.    3    AUX     stdaux    auxiliary device, generally COM1
  3568.    4    PRN     stdprn    standard printer, generally LPT1
  3569.  
  3570. If you are running short of handles, you can always close
  3571. stdaux to free up a handle.  The stdprn device can also be
  3572. closed as long as you don't use the printer or if you only
  3573. access the printer through LPRINT.  It is not a good idea to
  3574. close stdin, stdout, or stderr under normal circumstances.
  3575.  
  3576.    FClose1 Handle%
  3577.  
  3578. Handle%    handle of the file to close
  3579.  
  3580. Name  : FCreate              (File Create)
  3581. Class : Disk
  3582. Level : DOS
  3583.  
  3584. This routine creates a file and opens it for use by the PBClone
  3585. file handling routines.  If the file already existed, it will
  3586. be wiped out, so you may want to check beforehand if this is a
  3587. problem.  Try the Exist routine.
  3588.  
  3589. The file is opened in read/write mode, allowing both input and
  3590. output.
  3591.  
  3592. You may create the file using any of the following attributes:
  3593.  
  3594.    Normal          0      (nothing special)
  3595.    Read Only       1      file can be read, but not written to
  3596.    Hidden          2      file is "invisible"
  3597.    System          4      special DOS system file
  3598.  
  3599. The attributes can be combined by adding them together.  Don't
  3600. use the System attribute unless you know what you're doing!
  3601.  
  3602. Note that this routine does not support file sharing.  If that
  3603. is a problem, close the file just after it is created and
  3604. reopen it using FOpen1.
  3605.  
  3606.    FCreate FileName$, FAttr%, Handle%, ErrCode%
  3607.  
  3608. FileName$  name of the file to create
  3609. FAttr%     attribute(s) of the file
  3610. -------
  3611. Handle%    handle by which to access the file (if no error)
  3612. ErrCode%   error code: 0 if no error, else DOS Error
  3613.  
  3614. Name  : FDescRead$           (File Description Read)
  3615. Class : Disk
  3616. Level : DOS
  3617.  
  3618. This routine reads a 4DOS-style file description from disk.  If
  3619. there is no description or an error occurs, the result will be
  3620. a null string.
  3621.  
  3622.    FileDesc$ = FDescRead$(FileName$)
  3623.  
  3624. FileName$   file name
  3625. -------
  3626. FileDesc$   description of file, if any
  3627.  
  3628. Name  : FGetLoc              (File Get Location)
  3629. Class : Disk
  3630. Level : DOS
  3631.  
  3632. This routine tells you the position of the file pointer of a
  3633. file that was opened using FOpen1 or FCreate.  This pointer is
  3634. used to specify where the next item should be read from or
  3635. written to the file.  The first location of the file is
  3636. numbered 1.
  3637.  
  3638. See also FGetLoc2, the FUNCTION version of this routine.
  3639.  
  3640.    FGetLoc Handle%, Posn&
  3641.  
  3642. Handle%    handle of the file
  3643. -------
  3644. Posn&      location of the file pointer
  3645.  
  3646. Name  : FGetLoc2&            (File Get Location)
  3647. Class : Disk
  3648. Level : DOS
  3649.  
  3650. This routine tells you the position of the file pointer of a
  3651. file that was opened using FOpen1 or FCreate.  This pointer is
  3652. used to specify where the next item should be read from or
  3653. written to the file.  The first location of the file is
  3654. numbered 1.
  3655.  
  3656. See also FGetLoc, the SUB version of this routine.
  3657.  
  3658.    Posn& = FGetLoc2&(Handle%)
  3659.  
  3660. Handle%    handle of the file
  3661. -------
  3662. Posn&      location of the file pointer
  3663.  
  3664. Name  : FileCopy             (File Copy)
  3665. Class : Disk
  3666. Level : DOS
  3667.  
  3668. This routine copies one or more files, just like the DOS
  3669. command "COPY".
  3670.  
  3671. FileCopy works exactly like the DOS COPY command, except it
  3672. won't append files.  You may use wildcards in both source and
  3673. destination file specifications.  In the event of an error,
  3674. normal DOS error codes are returned, with two exceptions:
  3675.  
  3676.   -2  attempt to copy files over themselves
  3677.   -1  attempt to copy multiple sources to a single dest file
  3678.  
  3679. See also CopyFile, a simpler routine which doesn't support
  3680. wildcards.
  3681.  
  3682.    FileCopy SrcFile$, DestFile$, FCount%, ByteCount&, ErrCode%
  3683.  
  3684. SrcFile$    source file name(s)
  3685. DestFile$   destination file name(s)
  3686. -------
  3687. FCount%     number of files copied
  3688. ByteCount&  number of bytes copied
  3689. ErrCode%    error code (0 if no error)
  3690.  
  3691. Name  : FileCount            (File Count)
  3692. Class : Disk
  3693. Level : DOS
  3694.  
  3695. This routine returns the number of files which match a given
  3696. file specification and attribute.  You need to use this routine
  3697. before LoadDir or LoadDirAll in order to DIM the array to the
  3698. appropriate size.
  3699.  
  3700. The attribute can be any of the usual file attributes:
  3701.    1   Read-Only
  3702.    2   Hidden
  3703.    4   System
  3704.   16   Directory
  3705.  
  3706. You can combine attributes by adding their values.  For
  3707. instance, to search for hidden directories, you'd use an
  3708. attribute of 18.  By default, DOS returns normal files as well
  3709. as files which have the specified attributes, so an attribute
  3710. of 18 would get you normal files, hidden files, directories,
  3711. and hidden directories.  However, FileCount can be made to
  3712. screen out unwanted files-- just negate the attribute to force
  3713. only files of that attribute to be counted.  For example, an
  3714. attribute of -18 would return only hidden subdirectories.
  3715.  
  3716.    FileCount FileSpec$, FilAttr%, Count%, ErrCode%
  3717.  
  3718. We use FilAttr% instead of FileAttr%, since BASIC has a
  3719. built-in FILEATTR function.
  3720.  
  3721. FileSpec$   search filename (may contain wildcards)
  3722. FilAttr%    search file attribute
  3723. -------
  3724. Count%      number of matching files found
  3725. ErrCode%    error code (0 if no error)
  3726.  
  3727. Name  : FileCRC              (File CRC)
  3728. Class : Disk
  3729. Level : DOS
  3730.  
  3731. This routine calculates a 32-bit CRC for a file.  This CRC is
  3732. derived by a formula which takes each character of the file
  3733. into consideration.  It provides a powerful (although not 100%
  3734. foolproof) way to verify that a file hasn't changed since you
  3735. last checked.
  3736.  
  3737.    FileCRC FileName$, Result&, ErrCode%
  3738.  
  3739. FileName$   source file name(s)
  3740. -------
  3741. Result&     32-bit CRC of the file
  3742. ErrCode%    error code (0 if no error)
  3743.  
  3744. Name  : FindFirstA           (Find First file in an Archive)
  3745. Class : Disk
  3746. Level : DOS
  3747.  
  3748. The FindFirstA routine is used to find the first file that
  3749. matches search parameters which you specify.  Various
  3750. information about the file that matches (if any) can be
  3751. retrieved by other routines.
  3752.  
  3753. Rather than working on a directory, this routine works on files
  3754. in an archive.  Supported archives include ARC, ARJ, LZH, PAK,
  3755. ZIP and ZOO formats, as well as LZH-style self-extracting
  3756. archives in .COM or .EXE form.  If no extension is given, a
  3757. search will be made through each valid archive extension, and
  3758. the first matching archive will be used for the file search.
  3759.  
  3760. Archive names may contain drive and subdirectory
  3761. specifications, but not wildcards.  File names may contain
  3762. wildcards, but not drive/subdir specs.
  3763.  
  3764. When you are done searching, be sure to use CloseA to terminate
  3765. the search.
  3766.  
  3767. Routines in this series include:
  3768.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  3769.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  3770.  
  3771.    FindFirstA ArcName$, FileName$, ErrCode%
  3772.  
  3773. ArcName$    name of archive to search through
  3774. FileName$   name of file(s) for which to search
  3775. -------
  3776. ErrCode%    error code (0 if no error, else no matching files)
  3777.  
  3778. Name  : FindFirstF           (Find First File)
  3779. Class : Disk
  3780. Level : DOS
  3781.  
  3782. This is part of a set of routines included for compatibility
  3783. with ADVBAS and ProBas.  A better solution may be found in
  3784. FindFirstFx.
  3785.  
  3786. The FindFirstF routine is used to find the first file that
  3787. matches search parameters which you specify.  Various
  3788. information about the file that matches (if any) can be
  3789. retrieved by other routines.  See also FindNextF.
  3790.  
  3791. The file name specified may contain a drive and subdirectory
  3792. specification. Wildcards are also allowed.
  3793.  
  3794. Possible search attributes are as follows:
  3795.  
  3796.    Normal          0      (nothing special)
  3797.    Hidden          2      file is "invisible"
  3798.    System          4      special DOS system file
  3799.    Subdirectory   16      subdirectory
  3800.  
  3801. You can combine the attributes by adding them together.  All
  3802. searches will match if any of the specified attributes are
  3803. found, so if you're looking only for a specific attribute, you
  3804. will need to test the results using GetAttrF.
  3805.  
  3806. Routines in this series include:
  3807.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  3808.    GetTimeF, GetSizeFL
  3809.  
  3810.    FindFirstF FileName$, FAttr%, ErrCode%
  3811.  
  3812. FileName$   name of file(s) for which to search
  3813. FAttr%      file attribute(s) to seek
  3814. -------
  3815. ErrCode%    error code (0 if no error, else no matching files)
  3816.  
  3817. Name  : FindFirstFx          (Find First File, Extended)
  3818. Class : Disk
  3819. Level : DOS
  3820.  
  3821. The FindFirstFx routine is used to find the first file that
  3822. matches search parameters which you specify.  Various
  3823. information about the file that matches (if any) can be
  3824. retrieved by other routines.
  3825.  
  3826. The file name specified may contain a drive and subdirectory
  3827. specification. Wildcards are also allowed.
  3828.  
  3829. Possible search attributes are as follows:
  3830.  
  3831.    Normal          0      (nothing special)
  3832.    Read Only       1      file can be read, but not written to
  3833.    Hidden          2      file is "invisible"
  3834.    System          4      special DOS system file
  3835.    Subdirectory   16      subdirectory
  3836.  
  3837. You can combine the attributes by adding them together.  All
  3838. searches will match if any of the specified attributes are
  3839. found, so if you're looking only for a specific attribute, you
  3840. will need to test the results using GetAttrFx.
  3841.  
  3842. Routines in this series include:
  3843.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  3844.    GetTimeFx$, GetSizeFx&
  3845.  
  3846. These routines differ from the older FindFirstF-based series in
  3847. two major respects.  They include a Buffer$ parameter, which
  3848. allows you to have more than one search going on at a time.
  3849. This makes it safe to use these routines in subprograms without
  3850. conflict with the main program.  It also allows you to search
  3851. entire subdirectory trees recursively.  The other major
  3852. difference is that many of these routines are coded as
  3853. functions for greater convenience.
  3854.  
  3855.    Buffer$ = SPACE$(64)
  3856.    FindFirstFx Buffer$, FileName$, FAttr%, ErrCode%
  3857.  
  3858. FileName$   name of file(s) for which to search
  3859. FAttr%      file attribute(s) to seek
  3860. -------
  3861. Buffer$     buffer used in search (init to 64 characters)
  3862. ErrCode%    error code (0 if no error, else no matching files)
  3863.  
  3864. Name  : FindNextA            (Find Next file in an Archive)
  3865. Class : Disk
  3866. Level : DOS
  3867.  
  3868. This routine is for use after FindFirstA, to find any
  3869. additional archived files which may match your search
  3870. specifications.
  3871.  
  3872. Routines in this series include:
  3873.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  3874.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  3875.  
  3876.    FindNextA ErrCode%
  3877.  
  3878. -------
  3879. ErrCode%    error code (0 if no error, else no matching files)
  3880.  
  3881. Name  : FindNextF            (Find Next File)
  3882. Class : Disk
  3883. Level : DOS
  3884.  
  3885. This routine is for use after FindFirstF, to find any
  3886. additional files which may match your search specifications.
  3887.  
  3888. Routines in this series include:
  3889.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  3890.    GetTimeF, GetSizeFL
  3891.  
  3892.    FindNextF ErrCode%
  3893.  
  3894. -------
  3895. ErrCode%    error code (0 if no error, else no matching files)
  3896.  
  3897. Name  : FindNextFx           (Find Next File, Extended)
  3898. Class : Disk
  3899. Level : DOS
  3900.  
  3901. This routine is for use after FindFirstFx, to find any
  3902. additional files which may match your search specifications.
  3903.  
  3904. Routines in this series include:
  3905.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  3906.    GetTimeFx$, GetSizeFx&
  3907.  
  3908.    FindNextFx Buffer$, ErrCode%
  3909.  
  3910. Buffer$     buffer used in search
  3911. -------
  3912. Buffer$     updated buffer
  3913. ErrCode%    error code (0 if no error, else no matching files)
  3914.  
  3915. Name  : FindPatch            (Find Patch location)
  3916. Class : Disk
  3917. Level : DOS
  3918.  
  3919. This is one of a set of routines that allow you to write
  3920. self-modifying code. Your program can patch DATA statements in
  3921. itself or in another program, allowing you to save
  3922. configuration information (for example) without having to
  3923. create additional data files.
  3924.  
  3925. In order for this routine to work, you must have a series of
  3926. DATA statements containing quoted strings of the maximum
  3927. desired length.  The first DATA statement must contain a unique
  3928. string, as FindPatch will use it to locate the data block.
  3929. Note that if your program is patching itself, you must READ the
  3930. unique string rather than assigning it directly, to make sure
  3931. it's unique.  The string must exist at only one place in the
  3932. program.
  3933.  
  3934. See the PATCHER.BAS file if you would like clarification.  This
  3935. little demo program, when compiled, will patch itself with
  3936. whatever you enter on the command line.  For instance, if you
  3937. type PATCHER BANANA, it will store "BANANA" in its DATA
  3938. statement.  PDEMO will not work in the QuickBASIC environment,
  3939. of course.  You must compile it to an .EXE file.
  3940.  
  3941. You may compile the program using any switches.  You may not
  3942. use the /EXEPACK switch for LINK, though, as this may alter the
  3943. program DATA area.  Likewise, you must not use compression
  3944. utilities such as PKLite on the program.
  3945.  
  3946. Routines in this set include FindPatch, SetPatch, PatchDone.
  3947.  
  3948.    FindPatch FileName$, SearchSt$, ErrCode%
  3949.  
  3950. FileName$     name of the file to patch
  3951. SearchSt$     value of the first DATA statement
  3952. MoveBack%     not used
  3953. -------
  3954. ErrCode%      whether search worked (0 yes, <0 no, >0 Error)
  3955.  
  3956. Name  : FloorD#              (Floor, Double-precision)
  3957. Class : String
  3958. Level : Any
  3959.  
  3960. This function returns the largest integer less than or equal to
  3961. the number you give it.  This is most often used for rounding.
  3962.  
  3963.    Result# = FloorD#(Nr#)
  3964.  
  3965. Nr#          number to process
  3966. -------
  3967. Result#      result
  3968.  
  3969. Name  : FloorS!              (Floor, Single-precision)
  3970. Class : String
  3971. Level : Any
  3972.  
  3973. This function returns the largest integer less than or equal to
  3974. the number you give it.  This is most often used for rounding.
  3975.  
  3976.    Result! = FloorS!(Nr!)
  3977.  
  3978. Nr!          number to process
  3979. -------
  3980. Result!      result
  3981.  
  3982. Name  : Floppies             (Floppies installed)
  3983. Class : Equipment / Disk
  3984. Level : BIOS
  3985.  
  3986. The Floppies routine tells you how many floppy drives are
  3987. installed (0-4). See also Floppies2, a function version of this
  3988. routine.
  3989.  
  3990.    Floppies Drives%
  3991.  
  3992. -------
  3993. Drives%  number of floppy disk drives installed
  3994.  
  3995. Name  : Floppies2%           (Floppies installed)
  3996. Class : Equipment / Disk
  3997. Level : BIOS
  3998.  
  3999. The Floppies2 routine tells you how many floppy drives are
  4000. installed (0-4).
  4001.  
  4002.    Drives% = Floppies2%
  4003.  
  4004. -------
  4005. Drives%  number of floppy disk drives installed
  4006.  
  4007. Name  : FloppyType           (Floppy drive Type)
  4008. Class : Equipment / Disk
  4009. Level : Clone (AT)
  4010.  
  4011. This routine tells you what kinds of floppy drives are
  4012. installed, if any.  A code is returned for each drive, as
  4013. follows:
  4014.  
  4015.    0    no drive
  4016.    1    5 1/4"    360K
  4017.    2    5 1/4"    1.2M
  4018.    3    3 1/2"    720K
  4019.    4    3 1/2"    1.44M
  4020.  
  4021. Result codes of 5-7 are available, but not yet defined.  One
  4022. might guess that the 2.88M drive supported by DOS 5.0 will be
  4023. drive type 5.
  4024.  
  4025. Note that this routine supports a maximum of only two drives.
  4026. It is possible for a machine to have up to four drives, but
  4027. there is not currently any good way to find out about them.
  4028.  
  4029. FloppyType should only be used on AT-class machines.  It will
  4030. not work on PC/XT computers and may cause unusual results if
  4031. used on such machines.  It will also not work on some of the
  4032. earliest AT machines, which didn't adhere to the standard CMOS
  4033. format.
  4034.  
  4035.    FloppyType DriveA%, DriveB%
  4036.  
  4037. -------
  4038. DriveA%    drive type of first floppy drive
  4039. DriveB%    drive type of second floppy drive
  4040.  
  4041. Name  : FlushToDisk          (Flush file buffers To Disk)
  4042. Class : Disk
  4043. Level : DOS
  4044.  
  4045. This is a "file safety" routine for use with files opened by
  4046. FOpen1 or FCreate.  Files are normally buffered by DOS, which
  4047. makes file handling faster but creates the danger of losing the
  4048. file if there is a crash or power outage.  By flushing the file
  4049. to disk, you insure that it is updated to the current moment.
  4050.  
  4051. Note: this routine will need to temporarily create a new file
  4052. handle if DOS versions before 4.0 are used.
  4053.  
  4054.    FlushToDisk Handle%, ErrCode%
  4055.  
  4056. Handle%    handle of the file to flush
  4057. -------
  4058. ErrCode%   error code: 0 if none, else DOS Error
  4059.  
  4060. Name  : FOpen1               (File Open)
  4061. Class : Disk
  4062. Level : DOS
  4063.  
  4064. This routine opens an existing file for use with the PBClone
  4065. file handling routines.  If you need to create a file that
  4066. doesn't already exist, use the FCreate routine instead.
  4067.  
  4068. The file may be opened for reading, writing, or both:
  4069.  
  4070.    0   Read
  4071.    1   Write
  4072.    2   Read/Write
  4073.  
  4074. You may specify a file sharing mode for use with networks and
  4075. multitaskers. This will only take effect if the DOS version is
  4076. 3.0 or later and if the DOS SHARE utility has been executed.
  4077. Otherwise, it will be ignored.
  4078.  
  4079.    0   Normal       compatibility mode: no file sharing
  4080.    1   Exclusive    no one else may access the file
  4081.    2   Deny Write   no one else may write to the file
  4082.    3   Deny Read    no one else may read from the file
  4083.    4   Deny None    anyone else may read from or write to file
  4084.  
  4085. Most of the time, "Deny Write" will be appropriate.  This
  4086. allows others to read the file, but not to modify the file on
  4087. you unexpectedly.
  4088.  
  4089. See the discussion of predefined device handles at FClose1.
  4090.  
  4091.    FOpen1 FileName$, ReadWrite%, Sharing%, Handle%, ErrCode%
  4092.  
  4093. FileName$   name of the file to open
  4094. ReadWrite%  whether you want input, output, or both (see above)
  4095. Sharing%    file sharing mode (see above)
  4096. -------
  4097. Handle%    handle by which to access the file (if no error)
  4098. ErrCode%   error code: 0 if no error, else DOS Error
  4099.  
  4100. Name  : ForceMatch$          (Force Match of file to wildcard)
  4101. Class : Disk
  4102. Level : Any
  4103.  
  4104. The ForceMatch$ function allows you to mimic DOS commands that
  4105. operate on source file(s) and destination file(s).  It forces a
  4106. source file name to match a specified pattern (which may
  4107. contain wildcards), producing an appropriate destination file
  4108. name.
  4109.  
  4110. For example, if the source is "TESTNAME.BAS" and the pattern is
  4111. "?RUE*.*", the result would be "TRUENAME.BAS".
  4112.  
  4113. Consider the DOS command "COPY *.BAS A:*.BAK".  The "*.BAK"
  4114. part is the desired pattern.  The "*.BAS" part specifies which
  4115. files to copy to the new pattern.  Each filename that matches
  4116. "*.BAS" is translated through the "*.BAK" pattern to give the
  4117. destination filename.  The ForceMatch$ function is designed to
  4118. do this sort of translation for you.
  4119.  
  4120.    DestFile$ = ForceMatch$(Pattern$, SrcFile$)
  4121.  
  4122. Pattern$   pattern of desired file name (may contain wildcards)
  4123. SrcFile$   file name to force through the pattern
  4124. -------
  4125. DestFile$  resulting file name
  4126.  
  4127. Name  : FormatDate           (Format Date)
  4128. Class : Time
  4129. Level : Any
  4130.  
  4131. This is a highly flexible date formatting routine.  It accepts
  4132. a date in one of the usual American formats ("03-22-1990",
  4133. "03/22/90", or even "3/22/90") and converts it according to a
  4134. format string.  This format string allows you to normalize the
  4135. date, select a new delimiter, choose between two-digit and
  4136. four-digit years, and even change the order from month/day/year
  4137. to anything else.  An error code will be returned if the date
  4138. is not valid.
  4139.  
  4140. The format string can be as simple as "##/##/##", which
  4141. specifies that the usual month/day/year order be used, with a
  4142. delimiter of "/" and a two-digit year.  If you want to change
  4143. the date order, you would need a format like "DD.MM.YYYY"
  4144. instead.  For sorting or storage, you might want to convert the
  4145. date to a plain number, using a format string like "YYYYMMDD".
  4146. The result could then be converted to a LONG with the BASIC VAL
  4147. function.
  4148.  
  4149.    FormatDate DateSt$, Format$, Result$, ErrCode%
  4150.  
  4151. DateSt$     date to format (month, day, year order)
  4152. Format$     format for the date
  4153. -------
  4154. Result$     resulting date
  4155. ErrCode     whether the date is valid (0 ok)
  4156.  
  4157. Name  : FSetEnd              (File Set to End)
  4158. Class : Disk
  4159. Level : DOS
  4160.  
  4161. This moves the file pointer to the end of the file.  It is for
  4162. use with files opened by FOpen1 or FCreate.  The usual purpose
  4163. for this is to append information to an existing file.
  4164.  
  4165. Note that some text files may have a Control-Z or CHR$(26) on
  4166. the end.  For historical reasons, this character is sometimes
  4167. used as an "end of file" marker.  When dealing with text files,
  4168. you may want to examine the last character of the file to make
  4169. sure it isn't a Control-Z.
  4170.  
  4171. QuickBASIC is among the programs which, unfortunately, put a
  4172. Control-Z at the end of a file (if you OPEN for OUTPUT).  This
  4173. is a bad habit at best.
  4174.  
  4175.    FSetEnd Handle%
  4176.  
  4177. Handle%    handle of the file
  4178.  
  4179. Name  : FSetLoc              (File Set Location to byte)
  4180. Class : Disk
  4181. Level : DOS
  4182.  
  4183. This moves the file pointer to a specified position in the
  4184. file.  It is for use with files opened by FOpen1 or FCreate.
  4185. File positions are considered to start at 1.
  4186.  
  4187.    FSetLoc Handle%, Posn&
  4188.  
  4189. Handle%    handle of the file
  4190. Posn&      location to which to move
  4191.  
  4192. Name  : FSetOfs              (File Set location by Offset)
  4193. Class : Disk
  4194. Level : DOS
  4195.  
  4196. This moves the file pointer backwards or forwards in the file.
  4197. It is for use with files opened by FOpen1 or FCreate.
  4198.  
  4199.    FSetOfs Handle%, Offset&
  4200.  
  4201. Handle%    handle of the file
  4202. Offset&    number of bytes by which to move
  4203.  
  4204. Name  : FSetRec              (File Set location to Record)
  4205. Class : Disk
  4206. Level : DOS
  4207.  
  4208. This sets the file pointer to a specific record in the file.
  4209. It is for use with files opened by FOpen1 or FCreate.
  4210.  
  4211. This routine provides the same function as FSetLoc, but is a
  4212. bit more convenient for dealing with files composed of
  4213. fixed-length records.
  4214.  
  4215.    FSetRec Handle%, RecSize%, RecNr%
  4216.  
  4217. Handle%    handle of the file
  4218. RecSize%   number of bytes per record
  4219. RecNr%     number of record (starting at 1)
  4220.  
  4221. Name  : FSetSize             (File Set Size)
  4222. Class : Disk
  4223. Level : DOS
  4224.  
  4225. Many people have asked how to delete information from a file.
  4226. Well, there's no straightforward way to do it most of the time,
  4227. but if the record is at the end of the file, you can chop it
  4228. right off.
  4229.  
  4230. This routine can also be used to make a file larger, perhaps
  4231. pre-allocating space that will be used later (for better speed).
  4232.  
  4233. The file in question must have been opened by FCreate or FOpen1.
  4234.  
  4235.    FSetSize Handle%, Bytes&
  4236.  
  4237. Handle%    handle of the file
  4238. Bytes&     desired file size, in bytes
  4239.  
  4240. Name  : FSize                (File get Size)
  4241. Class : Disk
  4242. Level : DOS
  4243.  
  4244. This routine allows you to get the size of a file that was
  4245. opened by FOpen1 or FCreate.
  4246.  
  4247. See also FSize2, the FUNCTION version of this routine.
  4248.  
  4249.    FSize Handle%, Bytes&
  4250.  
  4251. Handle%    handle of the file
  4252. -------
  4253. Bytes&     file size, in bytes
  4254.  
  4255. Name  : FSize2&              (File get Size)
  4256. Class : Disk
  4257. Level : DOS
  4258.  
  4259. This routine allows you to get the size of a file that was
  4260. opened by FOpen1 or FCreate.
  4261.  
  4262. See also FSize, the Sub version of this routine.
  4263.  
  4264.    Bytes& = FSize2&(Handle%)
  4265.  
  4266. Handle%    handle of the file
  4267. -------
  4268. Bytes&     file size, in bytes
  4269.  
  4270. Name  : Get4DOSv             (Get 4DOS Version)
  4271. Class : Equipment
  4272. Level : DOS
  4273.  
  4274. The Get4DOSv routine returns the version of 4DOS being used.
  4275. It returns the results as two integers containing the major and
  4276. minor version numbers. For instance, 4DOS 4.0 would return a
  4277. major number of 4, minor 0.  If 4DOS is not installed, both
  4278. version numbers will be zero.
  4279.  
  4280. If you're not familiar with 4DOS, it's a terrific improved
  4281. replacement for COMMAND.COM.  For more information, write JP
  4282. Software Inc., P.O. Box 1470, Arlington MA 02174, or call your
  4283. local BBS.
  4284.  
  4285.    Get4DOSv MajorV%, MinorV%
  4286.  
  4287. -------
  4288. MajorV%   major part of the 4DOS version
  4289. MinorV%   minor part of the 4DOS version
  4290.  
  4291. Name  : GetAttrF             (Get Attribute of File)
  4292. Class : Disk
  4293. Level : DOS
  4294.  
  4295. The GetAttrF routine returns the attributes of a file matched
  4296. by FindFirstF or FindNextF.
  4297.  
  4298.    Normal          0      (nothing special)
  4299.    Read Only       1      file can be read, but not written to
  4300.    Hidden          2      file is "invisible"
  4301.    System          4      special DOS system file
  4302.    Subdirectory   16      subdirectory
  4303.    Archive        32      (used by some backup utilities)
  4304.  
  4305. You can see if a certain value is set using the AND operator:
  4306.  
  4307.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4308.  
  4309. Since the values are all powers of two, the AND operator makes
  4310. for a convenient way of decoding the results.
  4311.  
  4312. See also the ExplainFAttr$ function, which decodes the meanings
  4313. of the attribute for you.
  4314.  
  4315. Routines in this series include:
  4316.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4317.    GetTimeF, GetSizeFL
  4318.  
  4319.    GetAttrF FAttr%
  4320.  
  4321. -------
  4322. FAttr%   attributes that are set
  4323.  
  4324. Name  : GetAttrFx%           (Get Attribute of File, Extended)
  4325. Class : Disk
  4326. Level : DOS
  4327.  
  4328. The GetAttrFx% function returns the attributes of a file
  4329. matched by FindFirstFx or FindNextFx.
  4330.  
  4331.    Normal          0      (nothing special)
  4332.    Read Only       1      file can be read, but not written to
  4333.    Hidden          2      file is "invisible"
  4334.    System          4      special DOS system file
  4335.    Subdirectory   16      subdirectory
  4336.    Archive        32      (used by some backup utilities)
  4337.  
  4338. You can see if a certain value is set using the AND operator:
  4339.  
  4340.    IF FAttr% AND 16 THEN PRINT "Subdirectory"
  4341.  
  4342. Since the values are all powers of two, the AND operator makes
  4343. for a convenient way of decoding the results.
  4344.  
  4345. See also the ExplainFAttr$ function, which decodes the meanings
  4346. of the attribute for you.
  4347.  
  4348. Routines in this series include:
  4349.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4350.    GetTimeFx$, GetSizeFx&
  4351.  
  4352.    FAttr% = GetAttrFx%(Buffer$)
  4353.  
  4354. Buffer$   buffer used in search
  4355. -------
  4356. FAttr%    file attributes
  4357.  
  4358. Name  : GetColor             (Get Color)
  4359. Class : Display
  4360. Level : Clone
  4361.  
  4362. This routine tells you the current default foreground and
  4363. background colors being used by BASIC.  It should be used only
  4364. in text modes.
  4365.  
  4366.    GetColor Foreground%, Background%
  4367.  
  4368. -------
  4369. Foreground%   foreground color
  4370. Background%   background color
  4371.  
  4372. Name  : GetCommAddr          (Get Comm Address)
  4373. Class : Serial
  4374. Level : Clone
  4375.  
  4376. This routine allows you to determine the base port address of a
  4377. serial port. You tell it the COM port number (1-4) and it
  4378. returns the port address.  If there is no port installed, zero
  4379. will be returned.
  4380.  
  4381. Note that ports are "supposed" to be assigned sequentially-- in
  4382. other words, if you find a "zero" port address, there will be
  4383. no ports after that.  This is not necessarily the case,
  4384. however.  Some semi-standard machines may have a COM2 without a
  4385. COM1, for instance.  QuickBASIC gets confused in that case, but
  4386. it's no problem with my PBClone or BasWiz libraries.
  4387.  
  4388. Aside from purely informational purposes, this routine can be
  4389. useful in conjunction with SetCommAddr in manipulating the
  4390. serial ports.
  4391.  
  4392.    GetCommAddr PortNr%, PortAddr%
  4393.  
  4394. PortNr%     COM port number (1-4)
  4395. -------
  4396. PortAddr%   port address
  4397.  
  4398. Name  : GetCRCA              (Get CRC of Archive file)
  4399. Class : Disk / Time
  4400. Level : DOS
  4401.  
  4402. GetCRCA returns the 16-bit CRC of an archived file matched by
  4403. the FindFirstA or FindNextA routines.  Since some archives use
  4404. 32-bit CRCs, you may wish to use the more generic version of
  4405. this routine, GetCRCAL.
  4406.  
  4407. Routines in this series include:
  4408.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4409.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4410.  
  4411.    GetCRCA CRC16%
  4412.  
  4413. -------
  4414. CRC16%     16-bit CRC
  4415.  
  4416. Name  : GetCRCAL             (Get CRC of Archive file as Long)
  4417. Class : Disk / Time
  4418. Level : DOS
  4419.  
  4420. GetCRCAL returns the 32-bit CRC of an archived file matched by
  4421. the FindFirstA or FindNextA routines.  If the archive only has
  4422. a 16-bit CRC, the result is converted to 32 bits, so this
  4423. routine works with all archives.
  4424.  
  4425. Routines in this series include:
  4426.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4427.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4428.  
  4429.    GetCRCAL CRC32%
  4430.  
  4431. -------
  4432. CRC32%     32-bit CRC
  4433.  
  4434. Name  : GetCRT               (Get CRT)
  4435. Class : Display / Equipment
  4436. Level : Clone
  4437.  
  4438. The GetCRT routine simply tells you whether the current display
  4439. is capable of handling colors or not.  An unsophisticated
  4440. routine, GetCRT assumes that if the display is an MDA/Hercules,
  4441. it can't do color, but otherwise it can.
  4442.  
  4443. See also GetEGA, GetHGA and GetVGA.
  4444.  
  4445.    GetCRT Colour%
  4446.  
  4447. -------
  4448. Colour%   whether the display is color (0 if no)
  4449.  
  4450. Name  : GetCRT2%             (Get CRT)
  4451. Class : Display / Equipment
  4452. Level : Clone
  4453.  
  4454. The GetCRT2 routine simply tells you whether the current
  4455. display is capable of handling colors or not.  An
  4456. unsophisticated routine, GetCRT2 assumes that if the display is
  4457. an MDA/Hercules, it can't do color, but otherwise it can.
  4458.  
  4459. See also GetEGA, GetHGA and GetVGA.
  4460.  
  4461.    Colour% = GetCRT%
  4462.  
  4463. -------
  4464. Colour%   whether the display is color (0 if no)
  4465.  
  4466. Name  : GetDateA             (Get Date of Archive file)
  4467. Class : Disk / Time
  4468. Level : DOS
  4469.  
  4470. GetDateA returns the date of a archived file matched by the
  4471. FindFirstA or FindNextA routines.
  4472.  
  4473. Routines in this series include:
  4474.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  4475.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  4476.  
  4477.    GetDateA MonthNr%, DayNr%, YearNr%
  4478.  
  4479. -------
  4480. MonthNr%    month
  4481. DayNr%      day
  4482. YearNr%     year
  4483.  
  4484. Name  : GetDateAT            (Get Date from AT clock)
  4485. Class : Time
  4486. Level : BIOS (AT)
  4487.  
  4488. This routine gets the date from the hardware real-time clock in
  4489. AT-class computers.  Depending on the DOS version, this date
  4490. may be partially or completely independent of the date kept by
  4491. DOS in software.  DOS always reads the date from the hardware
  4492. clock when it starts up.  However, use of the DATE command in
  4493. DOS (and the DATE$ function in QuickBASIC) may relate only to
  4494. the software copy of the date, which is not always guaranteed
  4495. to be the same as the date in the hardware clock due to certain
  4496. discrepancies in DOS.
  4497.  
  4498.    GetDateAT MonthNr%, DayNr%, YearNr%, ErrCode%
  4499.  
  4500. -------
  4501. MonthNr%     month number (1-12)
  4502. DayNr%       day (1-31)
  4503. YearNr%      year (1980-2079)
  4504. ErrCode%     error code: 0 if no error, else clock has stopped
  4505.  
  4506. Name  : GetDateF             (Get Date of File)
  4507. Class : Disk / Time
  4508. Level : DOS
  4509.  
  4510. The GetDateF routine returns the date of a file matched by
  4511. FindFirstF or FindNextF.
  4512.  
  4513. Routines in this series include:
  4514.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  4515.    GetTimeF, GetSizeFL
  4516.  
  4517.    GetDateF MonthNr%, DayNr%, YearNr%
  4518.  
  4519. -------
  4520. MonthNr%    month
  4521. DayNr%      day
  4522. YearNr%     year
  4523.  
  4524. Name  : GetDateFx$           (Get Date of File, Extended)
  4525. Class : Disk / Time
  4526. Level : DOS
  4527.  
  4528. The GetDateFx$ function returns the date of a file matched by
  4529. FindFirstFx or FindNextFx.
  4530.  
  4531. Routines in this series include:
  4532.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  4533.    GetTimeFx$, GetSizeFx&
  4534.  
  4535.    FileDate$ = GetDateFx$(Buffer$)
  4536.  
  4537. Buffer$     buffer used in search
  4538. -------
  4539. FileDate$   date of file (e.g., "02-28-1991")
  4540.  
  4541. Name  : GetDOSv              (Get DOS Version)
  4542. Class : Equipment
  4543. Level : DOS
  4544.  
  4545. The GetDOSv routine tells you what version of DOS you're
  4546. using.  It returns the results as two integers containing the
  4547. major and minor version numbers. For instance, MS-DOS 2.11
  4548. would return a major number of 2, minor 11.
  4549.  
  4550. The OS/2 compatibility box returns version numbers beginning at
  4551. 10.00.  For instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0
  4552. returns 20.00.
  4553.  
  4554.    GetDOSv MajorV%, MinorV%
  4555.  
  4556. -------
  4557. MajorV%   major part of the DOS version
  4558. MinorV%   minor part of the DOS version
  4559.  
  4560. Name  : GetDrive$            (Get default Drive)
  4561. Class : Disk
  4562. Level : DOS
  4563.  
  4564. This routine tells you the letter of the current default drive.
  4565.  
  4566. See also GetDrv, the SUB version of this routine.
  4567.  
  4568.    Drive$ = GetDrive$
  4569.  
  4570. -------
  4571. Drive$    default drive letter.
  4572.  
  4573. Name  : GetDrv               (Get default Drive)
  4574. Class : Disk
  4575. Level : DOS
  4576.  
  4577. This routine tells you the letter of the current default drive.
  4578.  
  4579. See also GetDrive, the FUNCTION version of this routine.
  4580.  
  4581.    Drive$ = "x"
  4582.    GetDrv Drive$
  4583.  
  4584. -------
  4585. Drive$    default drive letter.  Init to at least one character.
  4586.  
  4587. Name  : GetDView             (Get DESQview version)
  4588. Class : Miscellaneous
  4589. Level : DOS
  4590.  
  4591. The GetDView routine tells you what version of DESQview is
  4592. loaded.  It returns the results as two integers containing the
  4593. major and minor version numbers.  For instance, DESQview 2.0
  4594. would return a major number of 2 and a minor number of 0.  If
  4595. DESQview is not loaded, zeroes are returned.
  4596.  
  4597. See also GetTView, GetTVScreen, UpdTVScreen.
  4598.  
  4599.    GetDView MajorV%, MinorV%
  4600.  
  4601. -------
  4602. MajorV%   major part of the DESQview version (0 if no DESQview)
  4603. MinorV%   minor part of the DESQview version
  4604.  
  4605. Name  : GetEGA               (Get EGA information)
  4606. Class : Display / Equipment
  4607. Level : BIOS
  4608.  
  4609. This routine tells you whether an EGA (or VGA) is available,
  4610. and if so, what kind.  It tells you whether the attached
  4611. display is monochrome or color, and how many kilobytes of RAM
  4612. are installed in the adapter.
  4613.  
  4614. Many early EGAs had only 64K of RAM.  Current adapters have
  4615. 256K or more. Since there are some limitations attached to
  4616. having only 64K, it's a good idea to see if this is the case--
  4617. most PBClone EGA routines won't work properly on 64k adapters.
  4618.  
  4619. See also GetCRT, GetHGA and GetVGA.
  4620.  
  4621. See also GetEGA2, the FUNCTION version of this routine.
  4622.  
  4623.    GetEGA Display%, KBytes%
  4624.  
  4625. -------
  4626. Display%  EGA display type: 0 no EGA, 1 EGA color, 2 EGA mono
  4627. KBytes%   kilobytes of display memory
  4628.  
  4629. Name  : GetEGA2%             (Get EGA information)
  4630. Class : Display / Equipment
  4631. Level : BIOS
  4632.  
  4633. This routine tells you whether an EGA (or VGA) is available.
  4634.  
  4635. See also GetCRT2, GetHGA and GetVGA2.
  4636.  
  4637. See also GetEGA, the SUB version of this routine.  It returns
  4638. additional information.
  4639.  
  4640.    IsEGA% = GetEGA2%
  4641.  
  4642. -------
  4643. IsEGA%    whether the display is an EGA (0 if no)
  4644.  
  4645. Name  : GetError             (Get Error code from DOS)
  4646. Class : Miscellaneous
  4647. Level : Clone
  4648.  
  4649. NOTE: The GetError2% function should be used in preference to
  4650. this routine.
  4651.  
  4652. The GetError routine is used in conjunction with CatchError.
  4653. It lets you get the exit code (error level) returned by a
  4654. program to which you have SHELLed. Since CatchError hooks an
  4655. interrupt to do its work, you must always make sure to use
  4656. GetError afterwards to "clean up".  See also CatchError.
  4657.  
  4658. Note that differences in DOS mean that this routine will not
  4659. always work.  In some versions of DOS, you can only get the
  4660. error level if a batch file was executed; in others, you can't
  4661. get the error level from a batch file at all. Sorry about
  4662. that.  I don't know of any way to work around it.
  4663.  
  4664.    CatchError
  4665.    SHELL ProgramName$
  4666.    GetError ExitCode%
  4667.  
  4668. -------
  4669. ExitCode%   exit code returned by SHELLed-to program (0-255)
  4670.  
  4671. Name  : GetError2%           (Get Error code from DOS)
  4672. Class : Miscellaneous
  4673. Level : DOS
  4674.  
  4675. The GetError2% function gets the exit code (error level)
  4676. returned by a program to which you have SHELLed.  It should be
  4677. used as soon as possible after the SHELL, and its value will
  4678. only be meaningful on the first call after the SHELL.
  4679.  
  4680. This routine should be used in preference to CatchError and
  4681. GetError.
  4682.  
  4683.    SHELL ProgramName$
  4684.    ExitCode% = GetError2%
  4685.  
  4686. -------
  4687. ExitCode%   exit code returned by SHELLed-to program (0-255)
  4688.  
  4689. Name  : GetExecPath          (Get Execution Path of program)
  4690. Class : Disk
  4691. Level : DOS 3.0+
  4692.  
  4693. This routine returns the full path of your program, i.e., the
  4694. drive, subdirectory, and name of the program.  It does not rely
  4695. on the current drive and subdirectory settings or look at the
  4696. PATH setting-- DOS tells it directly.  This makes it an
  4697. excellent way to find the program's "home" directory, where
  4698. (hopefully) any data files associated with the program will
  4699. also be stored.
  4700.  
  4701.    SelfName$ = SPACE$(80)
  4702.    GetExecPath SelfName$, SelfLen%
  4703.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  4704.  
  4705. -------
  4706. SelfName$   full path for current program.  Init to 80+ chars.
  4707. SelfLen%    length of the full path spec.
  4708.  
  4709. Name  : GetExtM              (Get Extended Memory)
  4710. Class : Memory / Equipment
  4711. Level : BIOS (AT)
  4712.  
  4713. This routine allows you to find out how much extended memory is
  4714. available. It should only be used on AT-class computers, since
  4715. older PCs do not support extended memory.  Note that some of
  4716. the very early AT machines will return erroneous results.
  4717.  
  4718. The amount of memory returned may be either the total amount of
  4719. extended memory installed or just the amount available at this
  4720. time, depending on how previously-installed programs (if any)
  4721. make use of extended memory. Unfortunately, there is no
  4722. standard which defines how a program should use extended memory
  4723. as there is with EMS (expanded memory), so there is no way for
  4724. a program to determine whether or how another program is using
  4725. extended memory.  Microsoft is trying to clear up this
  4726. situation with its HIMEM driver (available at your local BBS,
  4727. or [last I looked] free from Microsoft), but this approach
  4728. hasn't really become standard yet.
  4729.  
  4730.    GetExtM KBytes%
  4731.  
  4732. -------
  4733. KBytes%    the number of kilobytes of extended memory
  4734.  
  4735. Name  : GetFAttr             (Get File Attribute)
  4736. Class : Disk
  4737. Level : DOS
  4738.  
  4739. This routine lets you read the attributes of a file or
  4740. subdirectory.  The attributes may contain a combination of any
  4741. of the following:
  4742.  
  4743.    Normal          0      (nothing special)
  4744.    Read Only       1      file can be read, but not written to
  4745.    Hidden          2      file is "invisible"
  4746.    System          4      special DOS system file
  4747.    Subdirectory   16      subdirectory
  4748.    Archive        32      (used by some backup utilities)
  4749.  
  4750. You can see if a certain value is set by using the AND operator:
  4751.  
  4752.    IF FAttr% AND 2 THEN PRINT "Hidden file"
  4753.  
  4754. Since the values are all powers of two, the AND operator makes
  4755. for a convenient way of decoding the results.
  4756.  
  4757. See also the ExplainFAttr$ function, which decodes the meanings
  4758. of the attribute for you.
  4759.  
  4760.    GetFAttr FileName$, FAttr%
  4761.  
  4762. FileName$   name of the file (or subdirectory) to examine
  4763. -------
  4764. FAttr%      attributes that are set
  4765.  
  4766. Name  : GetFDate             (Get File Date)
  4767. Class : Disk / Time
  4768. Level : DOS
  4769.  
  4770. This routine gets the date of a file.
  4771.  
  4772.    GetFDate FileName$, MonthNr%, DayNr%, YearNr%
  4773.  
  4774. FileName$   name of the file to examine
  4775. -------
  4776. MonthNr%    month
  4777. DayNr%      day
  4778. YearNr%     year
  4779.  
  4780. Name  : GetFSize             (Get File Size)
  4781. Class : Disk
  4782. Level : DOS
  4783.  
  4784. This function gets the size of a file.
  4785.  
  4786.    FileSize& = GetFSize&(FileName$)
  4787.  
  4788. FileName$   name of the file to examine
  4789. -------
  4790. FileSize&   size of the file, in bytes
  4791.  
  4792. Name  : GetFTime             (Get File Time)
  4793. Class : Disk / Time
  4794. Level : DOS
  4795.  
  4796. This routine gets the time of a file.
  4797.  
  4798.    GetFTime FileName$, HourNr%, MinuteNr%, SecondNr%
  4799.  
  4800. FileName$     name of the file to examine
  4801. -------
  4802. HourNr%       hour
  4803. MinuteNr%     minute
  4804. SecondNr%     second (always even, due to DOS storage techniques)
  4805.  
  4806. Name  : GetHGA%              (Get Hercules Adapter info)
  4807. Class : Display / Equipment
  4808. Level : Clone
  4809.  
  4810. This routine tells you whether a Hercules-compatible monochrome
  4811. graphics adapter is in use.
  4812.  
  4813. See also GetCRT2, GetEGA and GetVGA2.
  4814.  
  4815.    IsHGA% = GetHGA%
  4816.  
  4817. -------
  4818. IsHGA%    whether the display is Hercules mono graphics (0 no)
  4819.  
  4820. Name  : GetKbd               (Get Keyboard toggles)
  4821. Class : Input
  4822. Level : Clone
  4823.  
  4824. The GetKbd routine allows you to get the state of the four
  4825. keyboard toggles: Insert, Caps lock, Num lock, and Scroll Lock.
  4826.  
  4827.    GetKbd Insert%, Caps%, Num%, Scrl%
  4828.  
  4829. -------
  4830. Insert%    whether "insert" mode is on (0 if no)
  4831. Caps%      whether "caps lock" is on (0 if no)
  4832. Num%       whether "num lock" is on (0 if no)
  4833. Scrl%      whether "scroll lock" is on (0 if no)
  4834.  
  4835. Name  : GetKbd1              (Get Keyboard Shifts)
  4836. Class : Input
  4837. Level : Clone
  4838.  
  4839. The GetKbd1 routine allows you to get the state of the four
  4840. keyboard shift keys: Left shift, Right shift, Control and Alt.
  4841.  
  4842.    GetKbd1 LShift%, RShift%, Control%, Alt%
  4843.  
  4844. -------
  4845. LShift%    whether the left shift key is depressed (0 if no)
  4846. RShift%    whether the right shift key is depressed (0 if no)
  4847. Control%   whether a control key is depressed (0 if no)
  4848. Alt%       whether an alt key is depressed (0 if no)
  4849.  
  4850. Name  : GetKbd2              (Get Keyboard Shifts)
  4851. Class : Input
  4852. Level : AT BIOS
  4853.  
  4854. The GetKbd2 routine allows you to get the state of the six
  4855. keyboard shift keys on an "enhanced" keyboard: Left shift,
  4856. Right shift, Left Control, Right Control, Left Alt and Right
  4857. Alt.
  4858.  
  4859. Normally, the BIOS only lets you see one key at a time, which
  4860. can be a barrier when you need more input.  This is a
  4861. particular problem with action games and other real-time
  4862. applications which have complex input requirements. Due to the
  4863. special way the BIOS treats shift keys, GetKbd2 can tell if the
  4864. the various shift keys are pressed simultaneously, allowing
  4865. more flexibility.
  4866.  
  4867.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  4868.  
  4869. -------
  4870. LShift%    whether the left shift key is depressed (0 if no)
  4871. RShift%    whether the right shift key is depressed (0 if no)
  4872. LCtrl%     whether the left control key is depressed (0 if no)
  4873. RCtrl%     whether the right control key is depressed (0 if no)
  4874. LAlt%      whether the left alt key is depressed (0 if no)
  4875. RAlt%      whether the right alt key is depressed (0 if no)
  4876.  
  4877. Name  : GetKey               (Get Key or mouse)
  4878. Class : Input, Mouse
  4879. Level : BIOS
  4880.  
  4881. This routine is kind of an extended version of INPUT$.  It
  4882. waits until a key is available at the keyboard and returns the
  4883. key pressed.  At your option, it can also return if a mouse
  4884. button is pressed.
  4885.  
  4886.    GetKey Mouse%, ASCIIcode%, ScanCode%, LButton%, RButton%
  4887.  
  4888. Mouse%        whether to check the mouse (0: no)
  4889. -------
  4890. ASCIIcode%    ASCII code of the key pressed
  4891. ScanCode%     scan code of the key pressed (0 if none)
  4892. LButton%   whether the left  mouse button was pressed
  4893. RButton%  whether the right mouse button was pressed
  4894.  
  4895. Name  : GetKey3              (Get Key or 3-button mouse)
  4896. Class : Input, Mouse
  4897. Level : BIOS
  4898.  
  4899. This routine is kind of an extended version of INPUT$.  It
  4900. waits until a key is available at the keyboard and returns the
  4901. key pressed.  At your option, it can also return if a mouse
  4902. button is pressed.
  4903.  
  4904.    GetKey3 Mouse%, ASCIIcode%, ScanCode%, LButton%,
  4905.       MButton%, RButton%
  4906.  
  4907. Mouse%        whether to check the mouse (0: no)
  4908. -------
  4909. ASCIIcode%    ASCII code of the key pressed
  4910. ScanCode%     scan code of the key pressed (0 if none)
  4911. LButton%      whether the left   mouse button is pressed
  4912. MButton%      whether the middle mouse button is pressed
  4913. RButton%      whether the right  mouse button is pressed
  4914.  
  4915. Name  : GetLabel             (Get disk volume Label)
  4916. Class : Disk
  4917. Level : DOS
  4918.  
  4919. This routine gets the volume label from a specified drive.  See
  4920. also GetLabel2$.
  4921.  
  4922.    Label$ = SPACE$(11)
  4923.    GetLabel Drive$, Label$, LabelLen%, ErrCode%
  4924.    Label$ = LEFT$(Label$, LabelLen%)
  4925.  
  4926. Drive$     letter of the drive to examine
  4927. -------
  4928. Label$     volume label of drive.  Init to >= 11 chars.
  4929. LabelLen%  length of the volume label
  4930. ErrCode%   error code: 0 if no error, else DOS Error
  4931.  
  4932. Name  : GetLabel2$           (Get disk volume Label)
  4933. Class : Disk
  4934. Level : DOS
  4935.  
  4936. This routine gets the volume label from a specified drive.  See
  4937. also GetLabel, a subprogram version of this routine.  The
  4938. GetLabel subprogram is preferable in that it returns an error
  4939. code, but you may find the function version more convenient if
  4940. error checking is not desired.
  4941.  
  4942.    Label$ = GetLabel2$(Drive$)
  4943.  
  4944. Drive$     letter of the drive to examine
  4945. -------
  4946. Label$     volume label of the specified drive.
  4947.  
  4948. Name  : GetLIMHandles        (Get L/I/M expanded mem Handles)
  4949. Class : Memory
  4950. Level : DOS
  4951.  
  4952. Early Lotus/Intel/Microsoft expanded memory revisions provided
  4953. a limited number of "handles" which could be used to access
  4954. expanded memory-- often as few as 15 or so.  If your program
  4955. uses expanded memory and the EMS driver is one of the older
  4956. versions, you may want to make sure that enough handles are
  4957. available.  This routine tells you how many handles are in use.
  4958.  
  4959. Note that this routine expects an EMS driver to be installed.
  4960. If you can't be sure of that, use GetLIMM first to avoid an
  4961. unpleasant surprise.
  4962.  
  4963.    GetLIMHandles Handles%
  4964.  
  4965. -------
  4966. Handles%  number of EMS handles in use
  4967.  
  4968. Name  : GetLIMM              (Get L/I/M expanded Memory)
  4969. Class : Memory / Equipment
  4970. Level : DOS
  4971.  
  4972. This routine tells you how much expanded memory is installed.
  4973. If there is none, or if the EMS driver hasn't been installed,
  4974. it returns zeroes.  You should use this routine before any
  4975. other of the PBClone routines that access expanded memory,
  4976. since the other routines expect EMS to be available.
  4977.  
  4978. The results are returned in terms of EMS pages.  Each page is
  4979. 16 kilobytes.
  4980.  
  4981.    GetLIMM TotalPages%, FreePages%
  4982.  
  4983. -------
  4984. TotalPages%  number of EMS pages installed
  4985. FreePages%   number of EMS pages available for use
  4986.  
  4987. Name  : GetLIMV              (Get L/I/M expanded mem Version)
  4988. Class : Memory / Equipment
  4989. Level : DOS
  4990.  
  4991. The GetLIMV routine tells you the version of EMS driver that is
  4992. being used. The version number is separated into major and
  4993. minor parts.  For example, an EMS 3.1 driver would return a
  4994. major number of 3 and minor number of 1.
  4995.  
  4996. Note that this routine expects an EMS driver to be installed.
  4997. If you can't be sure of that, use GetLIMM first to avoid an
  4998. unpleasant surprise.
  4999.  
  5000.    GetLIMV MajorVer%, MinorVer%
  5001.  
  5002. -------
  5003. MajorVer%  major part of the EMS version number
  5004. MinorVer%  minor part of the EMS version number
  5005.  
  5006. Name  : GetLine              (Get Line of text)
  5007. Class : Display
  5008. Level : Any
  5009.  
  5010. This routine retrieves a row of text from a saved (or virtual)
  5011. screen.
  5012.  
  5013. You can use GetLine with a saved screen of any size.  The St$
  5014. parameter must be initialized to the width of the saved screen
  5015. (in columns).
  5016.  
  5017.    St$ = SPACE$(ScrWidth)
  5018.    GetLine DSeg%, DOfs%, Row%, St$, SLen%
  5019.    St$ = LEFT$(St$, SLen%)
  5020.  
  5021. DSeg%      segment of saved screen
  5022. DOfs%      offset of saved screen
  5023. Row%       row of saved screen (starting at 1)
  5024. -------
  5025. St$        text at given row (init to width of saved screen)
  5026. SLen       logical length of text
  5027.  
  5028. Name  : GetMouseLoc          (Get Mouse Location)
  5029. Class : Mouse
  5030. Level : BIOS
  5031.  
  5032. This routine allows you to get the current location of the
  5033. mouse cursor.  It doesn't matter if the cursor is visible or
  5034. invisible.  GetMouseLoc is only for use in text mode.
  5035.  
  5036. This routine will not work properly if there is no mouse
  5037. available.  Use the MMCheck routine if you are not sure.
  5038.  
  5039. See also MMGetLoc, which returns the coordinates for graphics
  5040. mode.
  5041.  
  5042.    GetMouseLoc Row%, Column%
  5043.  
  5044. -------
  5045. Row%       mouse cursor row
  5046. Column%    mouse cursor column
  5047.  
  5048. Name  : GetMouseVer          (Get Mouse driver Version)
  5049. Class : Mouse
  5050. Level : BIOS
  5051.  
  5052. This routine retrieves various information about the mouse,
  5053. including the driver version number, mouse type, and IRQ used
  5054. by the mouse.
  5055.  
  5056. Note that this is among the mouse routines that makes you
  5057. wonder what Microsoft was thinking when they designed the mouse
  5058. driver.  The mouse driver has no provision for error codes and
  5059. the "get version" function was added comparatively recently, so
  5060. there is no way of knowing with certainty whether this routine
  5061. worked or what the mouse driver version is.  If that could be a
  5062. problem, you can reduce the risk by checking the returned
  5063. values to make sure they appear reasonable.
  5064.  
  5065. This routine will not work properly if there is no mouse
  5066. available.  Use the MMCheck routine if you are not sure.
  5067.  
  5068. The mouse type may be any of the following:
  5069.    1   bus mouse
  5070.    2   serial mouse
  5071.    3   InPort mouse
  5072.    4   PS/2 mouse
  5073.    5   Hewlett-Packard mouse
  5074.  
  5075. The IRQ will be 0 on the PS/2.  Otherwise, it will be 2-5 or 7
  5076. on Microsoft mice.  A mouse designed to take advantage of the
  5077. AT interrupt controller may use higher IRQs (to perhaps 15, I'm
  5078. not sure), so be generous if you do range checking here.
  5079.  
  5080. The version number is divided into two parts.  For instance,
  5081. mouse driver 8.20 would return a major version number of 8 and
  5082. a minor version number of 20.
  5083.  
  5084.    GetMouseVer MajorV%, MinorV%, MType%, IRQ%
  5085.  
  5086. -------
  5087. MajorV%    mouse driver major version number
  5088. MinorV%    mouse driver minor version number
  5089. MType%     mouse type
  5090. IRQ%       IRQ used by mouse
  5091.  
  5092. Name  : GetNameA             (Get Name of file in Archive)
  5093. Class : Disk
  5094. Level : DOS
  5095.  
  5096. GetNameA returns the name of an archived file matched by the
  5097. FindFirstA or FindNextA routines.  Since some archives may
  5098. include subdirectory specs along with the file name, it is
  5099. recommended that you initialize the return string to 80
  5100. characters (at least 12 are required).
  5101.  
  5102. When parsing filenames which may contain subdirectory specs,
  5103. keep in mind that the forward slash "/" may be used instead of
  5104. the backslash "\" for delimiting subdirectories.
  5105.  
  5106. In order to reach the very widest audience, you may also wish
  5107. to take into account filenames which may have originated on
  5108. non-PC systems.  In such filenames, the length of any part of
  5109. the path will not necessarily be restricted to the 11-plus-dot
  5110. of MS-DOS, the dot character may not mean anything special,
  5111. uppercase/lowercase distinctions may be significant, and
  5112. characters may be present which are not valid in MS-DOS names.
  5113.  
  5114. Routines in this series include:
  5115.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5116.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5117.  
  5118.    FileName$ = SPACE$(80)
  5119.    GetNameA FileName$, NameLen%
  5120.    FileName$ = LEFT$(FileName$, NameLen%)
  5121.  
  5122. -------
  5123. FileName$   file name (init to >= 12 characters, preferably 80)
  5124. NameLen%    length of file name
  5125.  
  5126. Name  : GetNameF             (Get Name of File)
  5127. Class : Disk
  5128. Level : DOS
  5129.  
  5130. The GetNameF routine returns the name of a file matched by
  5131. FindFirstF or FindNextF.  The name will not contain a drive or
  5132. subdirectory specification.
  5133.  
  5134. Routines in this series include:
  5135.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5136.    GetTimeF, GetSizeFL
  5137.  
  5138.    FileName$ = SPACE$(12)
  5139.    GetNameF FileName$, NameLen%
  5140.    FileName$ = LEFT$(FileName$, NameLen%)
  5141.  
  5142. -------
  5143. FileName$   file name (init to at least 12 characters)
  5144. NameLen%    length of file name
  5145.  
  5146. Name  : GetNameFx$           (Get Name of File, Extended)
  5147. Class : Disk
  5148. Level : DOS
  5149.  
  5150. The GetNameFx$ function returns the name of a file matched by
  5151. FindFirstFx or FindNextFx.  The name will not contain a drive
  5152. or subdirectory specification.
  5153.  
  5154. Routines in this series include:
  5155.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5156.    GetTimeFx$, GetSizeFx&
  5157.  
  5158.    FileName$ = GetNameFx$(Buffer$)
  5159.  
  5160. Buffer$       buffer used in search
  5161. -------
  5162. FileName$     file name
  5163.  
  5164. Name  : GetPrtAddr           (Get Printer Address)
  5165. Class : Printer
  5166. Level : Clone
  5167.  
  5168. This routine allows you to determine the base port address of a
  5169. parallel port.  You tell it the LPT port number (1-4) and it
  5170. returns the port address. If there is no port installed, zero
  5171. will be returned.
  5172.  
  5173. Note that up to four printer ports are (theoretically)
  5174. supported on most machines.  On PS/2 computers, only three
  5175. ports are allowed, and the fourth port data area is used for
  5176. other purposes.  So, it would probably be a good idea to
  5177. restrict your program to ports 1-3.
  5178.  
  5179. Aside from purely informational purposes, this routine can be
  5180. useful in conjunction with SetPrtAddr in manipulating the
  5181. parallel ports.
  5182.  
  5183.    GetPrtAddr PortNr%, PortAddr%
  5184.  
  5185. PortNr%     LPT port number (1-4 or 1-3 [see above])
  5186. -------
  5187. PortAddr%   port address
  5188.  
  5189. Name  : GetRows              (Get Rows on screen)
  5190. Class : Display
  5191. Level : Clone
  5192.  
  5193. This routine tells you how many rows are on the display.  This
  5194. is normally 25, but it may be greater on an EGA or VGA.  Only
  5195. text modes are supported.
  5196.  
  5197.    GetRows Rows%
  5198.  
  5199. -------
  5200. Rows%    text rows on the display
  5201.  
  5202. Name  : GetRows2%            (Get Rows on screen)
  5203. Class : Display
  5204. Level : Clone
  5205.  
  5206. This routine tells you how many rows are on the display.  This
  5207. is normally 25, but it may be greater on an EGA or VGA.  Only
  5208. text modes are supported.
  5209.  
  5210.    Rows% = GetRows2%
  5211.  
  5212. -------
  5213. Rows%    text rows on the display
  5214.  
  5215. Name  : GetScreen            (Get Screen)
  5216. Class : Display
  5217. Level : Clone
  5218.  
  5219. This routine saves any portion of the display to an array.
  5220. Only text modes are supported.  If your program uses multiple
  5221. display pages, you can get an image from any of those pages.  A
  5222. special "slow" mode is supported for the CGA, to prevent
  5223. flickering (a problem only with some CGAs).
  5224.  
  5225. The size of the integer array needed to store a specific area
  5226. of the screen can be calculated using the CalcSize routine
  5227. (see).
  5228.  
  5229. If you wish to save the entire screen, you may find ScrSave
  5230. easier (see).
  5231.  
  5232.    GetScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  5233.  
  5234. TRow%      top row of the desired screen area
  5235. LCol%      left column of the desired screen area
  5236. BRow%      bottom row of the desired screen area
  5237. RCol%      right column of the desired screen area
  5238. Page%      page from which to get the display area
  5239. Fast%      whether to use fast mode (0 no)
  5240. -------
  5241. Array%()   stored image of the selected area of the screen
  5242.  
  5243. Name  : GetSerial$           (Get disk Serial number)
  5244. Class : Disk
  5245. Level : DOS 4.0+
  5246.  
  5247. The GetSerial function returns the serial number of the
  5248. specified disk.  If there is no serial number, it returns
  5249. "0000-0000".
  5250.  
  5251.    SerialNr$ = GetSerial$(Drive$)
  5252.  
  5253. Drive$       drive to get serial # from ("" for current drive)
  5254. -------
  5255. SerialNr$    serial number of the specified drive
  5256.  
  5257. Name  : GetSizeAL            (Get Size of file in Archive Long)
  5258. Class : Disk
  5259. Level : DOS
  5260.  
  5261. GetSizeAL returns the size of an archived file matched by the
  5262. FindFirstA or FindNextA routines.
  5263.  
  5264. Routines in this series include:
  5265.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5266.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5267.  
  5268.    GetSizeAL OrigSize&, CurrSize&
  5269.  
  5270. -------
  5271. OrigSize&    original (uncompressed) file size
  5272. CurrSize&    current (compressed) file size
  5273.  
  5274. Name  : GetSizeFL            (Get Size of File as Long)
  5275. Class : Disk
  5276. Level : DOS
  5277.  
  5278. The GetSizeFL routine returns the size of a file matched by
  5279. FindFirstF or FindNextF.
  5280.  
  5281. Routines in this series include:
  5282.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5283.    GetTimeF, GetSizeFL
  5284.  
  5285.    GetSizeFL FileSize&
  5286.  
  5287. -------
  5288. FileSize&   file size
  5289.  
  5290. Name  : GetSizeFx&           (Get Size of File, Extended)
  5291. Class : Disk
  5292. Level : DOS
  5293.  
  5294. The GetSizeFx& function returns the size of a file matched by
  5295. FindFirstFx or FindNextFx.
  5296.  
  5297. Routines in this series include:
  5298.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5299.    GetTimeFx$, GetSizeFx&
  5300.  
  5301.    FileSize& = GetSizeFx&(Buffer$)
  5302.  
  5303. Buffer$     buffer used in search
  5304. -------
  5305. FileSize&   file size
  5306.  
  5307. Name  : GetStoreA            (Get Storage of file in Archive)
  5308. Class : Disk / Time
  5309. Level : DOS
  5310.  
  5311. GetStoreA returns the method used to compress an archived file
  5312. matched by the FindFirstA or FindNextA routines.
  5313.  
  5314. Routines in this series include:
  5315.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5316.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5317.  
  5318.    Storage$ = SPACE$(8)
  5319.    GetStoreA Storage$
  5320.  
  5321. -------
  5322. Storage$    storage method (init to 8 characters)
  5323.  
  5324. Name  : GetSub               (Get default Subdirectory)
  5325. Class : Disk
  5326. Level : DOS
  5327.  
  5328. The GetSub routine gets the current subdirectory on the default
  5329. drive.  It does not put a backslash at the start of the
  5330. subdirectory, so you should add this yourself.
  5331.  
  5332. See also GetSub1, which is a more advanced version of this
  5333. routine.
  5334.  
  5335.    SubDir$ = SPACE$(64)
  5336.    GetSub SubDir$, SubLen%
  5337.    SubDir$ = "\" + LEFT$(SubDir$, SubLen%)
  5338.  
  5339. -------
  5340. SubDir$    name of the current subdirectory. Init to 64+ chars
  5341. SubLen%    length of the subdirectory name
  5342.  
  5343. Name  : GetSub1              (Get default Subdirectory)
  5344. Class : Disk
  5345. Level : DOS
  5346.  
  5347. The GetSub1 routine gets the current subdirectory on a
  5348. specified drive. Unlike GetSub, it places a backslash at the
  5349. start of the name.  It also returns an error code, which allows
  5350. you to see if there was a disk error.
  5351.  
  5352. If you don't care about the error code, you may prefer GetSub2,
  5353. the FUNCTION version of this routine.
  5354.  
  5355.    SubDir$ = SPACE$(65)
  5356.    GetSub1 Drive$, SubDir$, SubLen%, ErrCode%
  5357.    SubDir$ = LEFT$(SubDir$, SubLen%)
  5358.  
  5359. Drive$     letter of the drive to check
  5360. -------
  5361. SubDir$    name of the current subdirectory. Init to 65+ chars
  5362. SubLen%    length of the subdirectory name
  5363. ErrCode%   error code: 0 if no error, else DOS Error
  5364.  
  5365. Name  : GetSub2$             (Get default Subdirectory)
  5366. Class : Disk
  5367. Level : DOS
  5368.  
  5369. The GetSub2 routine gets the current subdirectory on a
  5370. specified drive. Unlike GetSub, it places a backslash at the
  5371. start of the name.
  5372.  
  5373. See also GetSub1, the SUB version of this routine.  It returns
  5374. an error code.
  5375.  
  5376. If you just want the subdirectory of the current drive, you can
  5377. use a null string ("") as the drive letter.
  5378.  
  5379.    SubDir$ = GetSub2$(Drive$)
  5380.  
  5381. Drive$     letter of the drive to check
  5382. -------
  5383. SubDir$    name of the current subdirectory. Init to 65+ chars
  5384.  
  5385. Name  : GetSwitch            (Get Switch character)
  5386. Class : Miscellaneous
  5387. Level : DOS
  5388.  
  5389. An undocumented capability in many DOS versions allows you to
  5390. set the DOS "switch character", which is the delimiter used to
  5391. identify a switch on the DOS command line.  This is normally a
  5392. slash, as in "DIR /W".  However, many people prefer to change
  5393. it to a "-", which is the switch character used by Unix.
  5394.  
  5395. With the normal "/" delimiter, a backslash "\" is used in
  5396. subdirectory specifications.  DOS itself will recognize either
  5397. one as a subdirectory delimiter, but the command line won't
  5398. unless the switch char was changed.
  5399.  
  5400. The upshot of all this is, whereas you might normally use a
  5401. command like:
  5402.    DIR /W C:\GAMES
  5403.  
  5404. Someone with a different switch character might use something
  5405. like this:
  5406.    DIR -W C:/GAMES
  5407.  
  5408. This is exactly the sort of syntax that Unix commands use.
  5409.  
  5410. If you design your program to recognize the different
  5411. delimiters, you will make some people very happy!  The
  5412. GetSwitch routine will detect changed delimiters on those
  5413. versions of DOS which support it, and will return an ordinary
  5414. "/" on those versions of DOS which don't.
  5415.  
  5416.    Switch$ = "x"
  5417.    GetSwitch Switch$
  5418.  
  5419. -------
  5420. Switch$    the DOS switch character.  Init to one character.
  5421.  
  5422. Name  : GetSwitch2$          (Get Switch character)
  5423. Class : Miscellaneous
  5424. Level : DOS
  5425.  
  5426. This does exactly the same thing as the GetSwitch routine, but
  5427. it is a FUNCTION rather than a SUB.  For more information, see
  5428. GetSwitch.
  5429.  
  5430.    Switch$ = GetSwitch2$
  5431.  
  5432. -------
  5433. Switch$    the DOS switch character
  5434.  
  5435. Name  : GetTick&             (Get Tick)
  5436. Class : Time
  5437. Level : Clone
  5438.  
  5439. This function returns the system time.  This value represents
  5440. the time after midnight. There are about 18.2 ticks per second,
  5441. providing sufficiently fine resolution for most purposes.
  5442.  
  5443. If you use this function as part of a delay loop, keep in mind
  5444. that the value will wrap around at midnight, and that any given
  5445. value may be "skipped" due to causes beyond your control--
  5446. multitasking or background operations such as communications or
  5447. print spooling, for example.  So, DO NOT check for a specific
  5448. "end time"-- it may never come!  Instead, decrement a counter
  5449. whenever you notice that the time has changed since you last
  5450. checked.  This disassociates the delay from a specific time,
  5451. preventing lockups.
  5452.  
  5453.    Tick& = GetTick&
  5454.  
  5455. -------
  5456. Tick&        time after midnight (1/18.2 seconds)
  5457.  
  5458. Name  : GetTime              (Get Time)
  5459. Class : Time
  5460. Level : DOS
  5461.  
  5462. This routine tells you the time according to DOS.
  5463.  
  5464. The main difference between getting the time from BASIC and
  5465. getting it from DOS is the "hundredths of seconds" value.
  5466. However, this value is not available on some machines, in which
  5467. case it will be set to zero.  It is not accurate on most
  5468. machines, being calculated instead using a semi-random
  5469. approach; it is more of a novelty than a useful value.
  5470.  
  5471.    GetTime HourNr%, MinuteNr%, SecondNr%, Hundredth%
  5472.  
  5473. -------
  5474. HourNr%      hour (0-23)
  5475. MinuteNr%    minute
  5476. SecondNr%    second
  5477. Hundredth%   hundredth of a second.  See remarks, above.
  5478.  
  5479. Name  : GetTimeA             (Get Time of file in Archive)
  5480. Class : Disk / Time
  5481. Level : DOS
  5482.  
  5483. GetTimeA returns the time of an archived file matched by the
  5484. FindFirstA or FindNextA routines.
  5485.  
  5486. Routines in this series include:
  5487.    FindFirstA, FindNextA, GetNameA, GetCRCA, GetCRCAL,
  5488.    GetDateA, GetTimeA, GetSizeAL, GetStoreA
  5489.  
  5490.    GetTimeA HourNr%, MinuteNr%, SecondNr%
  5491.  
  5492. -------
  5493. HourNr%     hour
  5494. MinuteNr%   minute
  5495. SecondNr%   second
  5496.  
  5497. Name  : GetTimeAT            (Get Time from AT clock)
  5498. Class : Time
  5499. Level : BIOS (AT)
  5500.  
  5501. This routine gets the time from the hardware real-time clock in
  5502. AT-class computers.  Depending on the DOS version, this time
  5503. may be partially or completely independent of the time kept by
  5504. DOS in software.  DOS always reads the time from the hardware
  5505. clock when it starts up.  However, use of the TIME command in
  5506. DOS (and the TIME$ function in QuickBASIC) may relate only to
  5507. the software copy of the time, which is not always guaranteed
  5508. to be the same as the time in the hardware clock due to certain
  5509. discrepancies in DOS.
  5510.  
  5511.    GetTimeAT HourNr%, MinuteNr%, SecondNr%, ErrCode%
  5512.  
  5513. -------
  5514. HourNr%      hour (0-23)
  5515. MinuteNr%    minute
  5516. SecondNr%    second
  5517. ErrCode%     error code: 0 if no error, else clock has stopped
  5518.  
  5519. Name  : GetTimeF             (Get Time of File)
  5520. Class : Disk / Time
  5521. Level : DOS
  5522.  
  5523. The GetTimeF routine returns the time of a file matched by
  5524. FindFirstF or FindNextF.
  5525.  
  5526. Routines in this series include:
  5527.    FindFirstF, FindNextF, GetNameF, GetAttrF, GetDateF,
  5528.    GetTimeF, GetSizeFL
  5529.  
  5530.    GetTimeF HourNr%, MinuteNr%, SecondNr%
  5531.  
  5532. -------
  5533. HourNr%     hour
  5534. MinuteNr%   minute
  5535. SecondNr%   second
  5536.  
  5537. Name  : GetTimeFx$           (Get Time of File, Extended)
  5538. Class : Disk / Time
  5539. Level : DOS
  5540.  
  5541. The GetTimeFx$ function returns the time of a file matched by
  5542. FindFirstFx or FindNextFx.
  5543.  
  5544. Routines in this series include:
  5545.    FindFirstFx, FindNextFx, GetNameFx$, GetAttrFx%, GetDateFx$,
  5546.    GetTimeFx$, GetSizeFx&
  5547.  
  5548.    FileTime$ = GetTimeFx$(Buffer$)
  5549.  
  5550. Buffer$      buffer used in search
  5551. -------
  5552. FileTime$    file time (e.g., "17:53:20")
  5553.  
  5554. Name  : GetTView             (Get TopView)
  5555. Class : Miscellaneous
  5556. Level : BIOS
  5557.  
  5558. This routine tells you whether TopView or a compatible
  5559. multitasker (such as TaskView or DESQview) is loaded.
  5560.  
  5561. See also GetDView, GetTVScreen, UpdTVScreen.
  5562.  
  5563.    GetTView Installed%
  5564.  
  5565. -------
  5566. Installed%   whether a TopView-type multitasker is loaded
  5567.  
  5568. Name  : GetTVScreen          (Get TopView Screen address)
  5569. Class : Display / Miscellaneous
  5570. Level : BIOS
  5571.  
  5572. GetTVScreen returns the address of the screen buffer used by a
  5573. TopView-type multitasker.  This allows you to use direct screen
  5574. access while remaining within the windows allocated to your
  5575. program by the multitasker.
  5576.  
  5577. You must tell the multitasker the address of the screen you
  5578. would be writing to if the multitasker was not installed.
  5579. Specify a segment of &HB000 if using an MDA or Hercules, or a
  5580. segment of &HB800 for CGA, EGA, MCGA or VGA. The offset should
  5581. always be 0.  This is for use in text modes.
  5582.  
  5583. The routine will return with the new segment and offset for you
  5584. to use. These values can be used with any PBClone screen
  5585. routine that accepts a segment and offset-- DQPrint and
  5586. DXQPrint, for example.
  5587.  
  5588. Note that not all TopView-compatible multitaskers will
  5589. automatically update the screen from the buffer.  The
  5590. UpdTVScreen routine allows you to force a screen update.
  5591.  
  5592. See also GetDView, GetTView, UpdTVScreen.
  5593.  
  5594.    GetTVScreen DSeg%, DOfs%
  5595.  
  5596. DSeg%       segment of desired screen
  5597. DOfs%       offset of desired screen
  5598. -------
  5599. DSeg%       segment of screen buffer
  5600. DOfs%       offset of screen buffer
  5601.  
  5602. Name  : GetValidKey          (Get Valid Key)
  5603. Class : Input
  5604. Level : DOS
  5605.  
  5606. This one is useful for getting one of a list of keys from the
  5607. keyboard.  You give it a list of keys (letters should be
  5608. uppercase) to accept.  It will wait until one of the listed
  5609. keys is pressed; for letters, it will accept either lowercase
  5610. or uppercase keys, but will convert the letter to uppercase
  5611. before it returns to you.  If you pass it a blank list, it will
  5612. accept any key.
  5613.  
  5614. This routine is handy for when you want to allow one of a list
  5615. of choices from a menu, for instance.
  5616.  
  5617.    GetValidKey GoodList$, Result$
  5618.  
  5619. GoodList$    list of acceptable keys.  See above for remarks.
  5620. -------
  5621. Result$      the key that was accepted (uppercase if letter)
  5622.  
  5623. Name  : GetVerify            (Get Verify setting)
  5624. Class : Disk
  5625. Level : DOS
  5626.  
  5627. The GetVerify routine tells you the state of the DOS VERIFY
  5628. flag.  When VERIFY is on, some checking is done to make sure
  5629. that writing to the disk works as requested.  The checks are
  5630. not very good, however, and VERIFY slows down disk handling, so
  5631. it is usually better to have VERIFY off.
  5632.  
  5633. You can change the state of VERIFY by using the DOS VERIFY
  5634. command or with the SetVerify routine in PBClone.
  5635.  
  5636.    GetVerify VerifyOn%
  5637.  
  5638. -------
  5639. VerifyOn%   whether VERIFY is on (0 if no)
  5640.  
  5641. Name  : GetVGA               (Get VGA information)
  5642. Class : Display / Equipment
  5643. Level : BIOS
  5644.  
  5645. This routine tells you whether a VGA is available.
  5646.  
  5647. See also GetCRT, GetEGA and GetHGA.
  5648.  
  5649.    GetVGA IsVGA%
  5650.  
  5651. -------
  5652. IsVGA%    whether a VGA is installed (0 if no)
  5653.  
  5654. Name  : GetVGA2%             (Get VGA information)
  5655. Class : Display / Equipment
  5656. Level : BIOS
  5657.  
  5658. This routine tells you whether a VGA is available.
  5659.  
  5660. See also GetCRT, GetEGA and GetHGA.
  5661.  
  5662.    IsVGA% = GetVGA2%
  5663.  
  5664. -------
  5665. IsVGA%    whether a VGA is installed (0 if no)
  5666.  
  5667. Name  : GetVGAColor          (Get VGA Color)
  5668. Class : Display
  5669. Level : BIOS
  5670.  
  5671. This routine gets the components of a single VGA palette color.
  5672. It returns the color value associated with a given color number.
  5673.  
  5674. If you are dealing with more than one color at a time, you may
  5675. find GetVGAPalette more appropriate.
  5676.  
  5677.    GetVGAColor ColorNr%, Red%, Green%, Blue%
  5678.  
  5679. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  5680. -------
  5681. Red%       red intensity (0-63)
  5682. Green%     green intensity (0-63)
  5683. Blue%      blue intensity (0-63)
  5684.  
  5685. Name  : GetVGAPalette        (Get VGA Palette)
  5686. Class : Display
  5687. Level : BIOS
  5688.  
  5689. This routine allows you to get any number of the VGA palette
  5690. settings into a TYPEd array.  The TYPE for the array should be
  5691. defined like this:
  5692.  
  5693.    TYPE Palet
  5694.       IRed AS STRING * 1
  5695.       IBlue AS STRING * 1
  5696.       IGreen AS STRING * 1
  5697.    END TYPE
  5698.  
  5699. This type holds a CHR$-encoded representation of the intensity
  5700. of each component of the color.  The values range from 0-63.
  5701.  
  5702. If you are only dealing with a few colors, you may find it more
  5703. convenient to use GetVGAColor instead.
  5704.  
  5705.    GetVGAPalette DSeg%, DOfs%, Start%, Colors%
  5706.  
  5707. DSeg%      segment of the palette array
  5708. DOfs%      offset of the palette array
  5709. Start%     color number to start with
  5710. Colors%    number of colors to get
  5711.  
  5712. Name  : GetVidMode           (Get Video Mode)
  5713. Class : Display
  5714. Level : BIOS
  5715.  
  5716. The GetVidMode routine tells you about the current display
  5717. status from the BIOS' point of view.  Note that the BIOS
  5718. display mode is not the same as the BASIC SCREEN mode (a direct
  5719. translation between the two is messy, because BASIC
  5720. conglomerates several BIOS modes into a single SCREEN mode in
  5721. several instances).
  5722.  
  5723.    GetVidMode BIOSMode%, ScreenWidth%, ActivePage%
  5724.  
  5725. -------
  5726. BIOSMode%     BIOS video mode
  5727. ScreenWidth%  number of columns per row
  5728. ActivePage%   active (visible) display page
  5729.  
  5730. Name  : GetXMSm              (Get XMS Memory)
  5731. Class : Memory / Equipment
  5732. Level : DOS
  5733.  
  5734. This routine tells you how much XMS memory is available.  If
  5735. there is none, or if the XMS driver hasn't been installed, it
  5736. returns zeroes.  Memory is returned kilobytes.
  5737.  
  5738.    GetXMSm LargestFree&, TotalFree&
  5739.  
  5740. -------
  5741. LargestFree&  largest free block of XMS memory
  5742. TotalFree&    total free XMS memory
  5743.  
  5744. Name  : GetXMSv              (Get XMS Version)
  5745. Class : Memory / Equipment
  5746. Level : BIOS
  5747.  
  5748. The GetXMSv routine tells you the version of XMS driver that is
  5749. being used. The version number is separated into major and
  5750. minor parts.  For example, an XMS 2.0 driver would return a
  5751. major number of 2 and minor number of 0.
  5752.  
  5753.    GetXMSv MajorVer%, MinorVer%
  5754.  
  5755. -------
  5756. MajorVer%  major part of the XMS version number
  5757. MinorVer%  minor part of the XMS version number
  5758.  
  5759. Name  : GLoad                (Graphics Load)
  5760. Class : Disk
  5761. Level : DOS
  5762.  
  5763. A replacement for the BASIC BLOAD statement, this routine loads
  5764. a binary memory image from a file into the area of memory it
  5765. formerly occupied.  This is most often used to restore a screen
  5766. display from a file, although PBClone offers more flexible
  5767. alternatives.
  5768.  
  5769.    GLoad FileName$
  5770.  
  5771. FileName$    name of the file to load into memory
  5772.  
  5773. Name  : GQPrint              (Graphics Quick Print)
  5774. Class : Display
  5775. Level : Clone
  5776.  
  5777. This is a simple high-speed replacement for the PRINT statement
  5778. which works in CGA graphics mode (SCREEN 2).  It does not
  5779. interpret control codes, support graphics characters (ASCII
  5780. 128-255), or update the cursor position, in return for which it
  5781. is much faster than PRINT.
  5782.  
  5783. The Fast% parameter is ignored at the moment-- top speed is
  5784. always used, which may cause flickering on some CGAs.
  5785.  
  5786.    GQPrint St$, Row%, Column%, Fast%
  5787.  
  5788. St$      string to display
  5789. Row%     row (1-25)
  5790. Column%  column (1-80)
  5791. Fast%    not used
  5792.  
  5793. Name  : GrafPrint            (Graphics Print)
  5794. Class : Display
  5795. Level : Clone
  5796.  
  5797. This is a flexible replacement for the PRINT statement which
  5798. operates in graphics mode.  It allows you to display text at
  5799. graphics coordinates instead of text coordinates for better
  5800. alignment with graphs and so forth.  It also lets you specify
  5801. the size of the font-- you can stretch it in either vertical or
  5802. horizontal directions, or both, using a font multiplier value.
  5803.  
  5804. The disadvantages of this routine are that it is slower than an
  5805. ordinary PRINT, only does foreground printing (if you need a
  5806. background color, you need to fill that in yourself
  5807. beforehand), won't do automatic wrap or scroll, and won't
  5808. handle control codes or graphics characters (ASCII 0-31,
  5809. 127-255). The font is based on the normal CGA graphics font,
  5810. which uses an 8x8 grid for each character.
  5811.  
  5812. GrafPrint will work in any graphics mode.
  5813.  
  5814.    GrafPrint St$, X%, Y%, High%, Wide%
  5815.  
  5816. St$      string to display
  5817. X%       graphics column to start at
  5818. Y%       graphics row to start at
  5819. High%    font height multiplier
  5820. Wide%    font width multiplier
  5821.  
  5822. Name  : GrafRest             (Graphics Restore)
  5823. Class : Display
  5824. Level : Clone
  5825.  
  5826. This routine allows you to restore a SCREEN 1 (CGA, 320x200, 4
  5827. color) or SCREEN 2 (CGA, 640x200, 2 color) display that was
  5828. saved using GrafSave (see).
  5829.  
  5830.    GrafRest DSeg%, DOfs%
  5831.  
  5832. DSeg%      segment of storage array, returned by VARSEG
  5833. DOfs%      offset  of storage array, returned by VARPTR
  5834.  
  5835. Name  : GrafSave             (Graphics Save)
  5836. Class : Display
  5837. Level : Clone
  5838.  
  5839. This routine allows you to save a SCREEN 1 (CGA, 320x200, 4
  5840. color) or SCREEN 2 (CGA, 640x200, 2 color) display that can be
  5841. restored using GrafRest (see).
  5842.  
  5843. The array used to hold the screen must contain 16,000 bytes.
  5844. For an integer array, this means that you must create the array
  5845. by DIM Array%(1 TO 8000).
  5846.  
  5847.    GrafSave DSeg%, DOfs%
  5848.  
  5849. DSeg%      segment of storage array, returned by VARSEG
  5850. DOfs%      offset  of storage array, returned by VARPTR
  5851.  
  5852. Name  : GXQPrint             (Graphics Extended Quick Print)
  5853. Class : Display
  5854. Level : Clone
  5855.  
  5856. This is a simple high-speed replacement for the PRINT statement
  5857. which works in CGA graphics mode (SCREEN 1).  It does not
  5858. interpret control codes, support graphics characters (ASCII
  5859. 128-255), or update the cursor position, in return for which it
  5860. is much faster than PRINT.
  5861.  
  5862. This routine can also be used in SCREEN 2, where it will
  5863. display the string in shades instead of in color (using 40
  5864. columns/row).
  5865.  
  5866. The Fast% parameter is ignored at the moment-- top speed is
  5867. always used, which may cause flickering on some CGAs.
  5868.  
  5869.    GXQPrint St$, Row%, Column%, Fore%, Fast%
  5870.  
  5871. St$      string to display
  5872. Row%     row (1-25)
  5873. Column%  column (1-40)
  5874. Fore%    foreground color (0-3)
  5875. Fast%    not used
  5876.  
  5877. Name  : GXQPrint1            (Graphics Extended Quick Print)
  5878. Class : Display
  5879. Level : Clone
  5880.  
  5881. This is a high-speed replacement for the PRINT statement which
  5882. works in CGA graphics mode (SCREEN 1).  It does not interpret
  5883. control codes or update the cursor position, in return for
  5884. which it is much faster than PRINT.
  5885.  
  5886. This routine can also be used in SCREEN 2, where it will
  5887. display the string in shades instead of in color (using 40
  5888. columns/row).
  5889.  
  5890. The Fast% parameter is ignored at the moment-- top speed is
  5891. always used, which may cause flickering on some CGAs.
  5892.  
  5893.    GXQPrint1 St$, Row%, Column%, Fore%, Back%, Fast%
  5894.  
  5895. St$      string to display
  5896. Row%     row (1-25)
  5897. Column%  column (1-40)
  5898. Fore%    foreground color (0-3)
  5899. Back%    background color (0-3)
  5900. Fast%    not used
  5901.  
  5902. Name  : HandleInfo           (Handle Information)
  5903. Class : Miscellaneous
  5904. Level : DOS
  5905.  
  5906. HandleInfo tells you whether a file handle refers to a file or
  5907. to a device. If the handle does not exist, an error code will
  5908. be returned.
  5909.  
  5910. This is for file handles as returned by FOpen1 and FCreate. It
  5911. can also be used with file numbers associated with OPEN, via a
  5912. BASIC function that was introduced with QuickBASIC 4.0:
  5913.  
  5914.    Handle% = FILEATTR(FileNumber%, 2)
  5915.  
  5916. See FClose1 for a list of predefined handles.
  5917.  
  5918.    HandleInfo Handle%, Device%, ErrCode%
  5919.  
  5920. Handle%    file handle
  5921. -------
  5922. Device%    whether the handle refers to a device (0 no)
  5923. ErrCode%   whether there was an error (0 no)
  5924.  
  5925. Name  : HCls                 (Hercules CLS)
  5926. Class : Display
  5927. Level : Clone
  5928.  
  5929. This routine clears a Hercules graphics screen to the specified
  5930. color.
  5931.  
  5932. Routines in this series are:
  5933.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  5934.  
  5935.    HCls Colour%
  5936.  
  5937. Colour%    color (0-1)
  5938.  
  5939. Name  : HiByte%              (High Byte)
  5940. Class : Numeric
  5941. Level : Any
  5942.  
  5943. This function returns the high byte of an integer.
  5944.  
  5945.    Byte% = HiByte%(Nr%)
  5946.  
  5947. Nr%        integer
  5948. -------
  5949. Byte%      value of the most significant byte
  5950.  
  5951. Name  : HiLite               (Highlight)
  5952. Class : Display
  5953. Level : Clone
  5954.  
  5955. This routine allows you to highlight text on the screen.  It
  5956. works in text modes only and always displays to the visible
  5957. screen page.
  5958.  
  5959. See also ReColorArea, which lets you highlight any rectangular
  5960. area of the screen.
  5961.  
  5962.    HiLite Row%, LCol%, RCol%, VAttr%
  5963.  
  5964. Row%       row on which to highlight
  5965. LCol%      left column (where highlight starts)
  5966. RCol%      right column (where highlight ends)
  5967. VAttr%     new color (see CalcAttr)
  5968.  
  5969. Name  : HiWord%              (High Word)
  5970. Class : Numeric
  5971. Level : Any
  5972.  
  5973. This function returns the high word of a long integer.
  5974.  
  5975.    Word% = HiWord%(Nr&)
  5976.  
  5977. Nr&        long integer
  5978. -------
  5979. Word%      value of the most significant word
  5980.  
  5981. Name  : HLine                (Hercules LINE)
  5982. Class : Display
  5983. Level : Clone
  5984.  
  5985. This routine draws a line on a Hercules graphics screen.
  5986.  
  5987. Routines in this series are:
  5988.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  5989.  
  5990.    HLine X1%, Y1%, X2%, Y2%, Colour%
  5991.  
  5992. X1%        starting graphics column (0-719)
  5993. Y1%        starting graphics row (0-347)
  5994. X2%        ending graphics column (0-719)
  5995. Y2%        ending graphics row (0-347)
  5996. Colour%    color (0-1)
  5997.  
  5998. Name  : HMode                (Hercules Mode)
  5999. Class : Display
  6000. Level : Clone
  6001.  
  6002. This routine switches between text mode and Hercules graphics
  6003. mode.  Use HInit first to initialize the graphics mode
  6004. appropriately.
  6005.  
  6006. HMode will clear page 0 when graphics mode is entered.  Page 1,
  6007. if it exists, is not cleared.  PBClone does not support page 1
  6008. in any respect.
  6009.  
  6010. Routines in this series are:
  6011.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6012.  
  6013.    HMode Graphics%
  6014.  
  6015. Graphics%    display mode to set (0 text, else graphics)
  6016.  
  6017. Name  : HPrint               (Hercules Print)
  6018. Class : Display
  6019. Level : Clone
  6020.  
  6021. This routine displays text in Hercules graphics mode.   It uses
  6022. the full resolution of the screen, so text is 90 columns by 43
  6023. rows.  This gives you more space than even the largest EGA text
  6024. mode, which is only 80x43.
  6025.  
  6026. Routines in this series are:
  6027.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6028.  
  6029.    HPrint St$, Row%, Column%
  6030.  
  6031. St$        text to display
  6032. Row%       row (1-43)
  6033. Column%    column (1-90)
  6034.  
  6035. Name  : HSetPixel            (Hercules Set Pixel)
  6036. Class : Display
  6037. Level : Clone
  6038.  
  6039. This routine draws a dot on a Hercules graphics screen.
  6040.  
  6041. Routines in this series are:
  6042.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6043.  
  6044.    HSetPixel X%, Y%, Colour%
  6045.  
  6046. X%         graphics column (0-719)
  6047. Y%         graphics row (0-347)
  6048. Colour%    color (0-1)
  6049.  
  6050. Name  : HTestPixel           (Hercules Test Pixel)
  6051. Class : Display
  6052. Level : Clone
  6053.  
  6054. This routine returns the color of a dot on a Hercules graphics
  6055. screen.
  6056.  
  6057. Routines in this series are:
  6058.    HCls, HLine, HMode, HPrint, HSetPixel, HTestPixel
  6059.  
  6060.    Colour% = HTestPixel%(X%, Y%)
  6061.  
  6062. X%         graphics column (0-719)
  6063. Y%         graphics row (0-347)
  6064. -------
  6065. Colour%    color (0-1)
  6066.  
  6067. Name  : IdentifyFile         (Identify File)
  6068. Class : Disk
  6069. Level : DOS
  6070.  
  6071. Given a file name, this routine attempts to identify what kind
  6072. of file it is. Most information is derived from the file
  6073. extension, but some files are processed more deeply.  For
  6074. instance, a file named "UNKNOWN.BAS" will be checked to see if
  6075. it is source code (tokenized GWBASIC format, tokenized
  6076. QuickBASIC format, or plain ASCII text) or a binary BSAVE/BLOAD
  6077. image (which is further categorized as to whether it is a
  6078. screen image, and if so, for what kind of display).
  6079.  
  6080.    Descript$ = SPACE$(80)
  6081.    IdentifyFile FileName$, Descript$, DescrLen%
  6082.    Descript$ = LEFT$(Descript$, DescrLen%)
  6083.  
  6084. FileName$    name of the file to identify
  6085. -------
  6086. Descript$    description of the file (init to at least 80 chars)
  6087. DescrLen%    length of the description
  6088.  
  6089. Name  : InitPtr              (Initialize Pointers)
  6090. Class : Array management
  6091. Level : Any
  6092.  
  6093. This routine initializes an array of pointers for use with the
  6094. pointer sort routines (PSortD, et al).  It may also be useful
  6095. for other purposes.  Each element of the array is set equal to
  6096. its index (the first element is set to 1, the second to 2, and
  6097. so forth).  Arrays are expected to begin at element 1.  You may
  6098. specify the last element to initialize, allowing you to use
  6099. only part of an array.
  6100.  
  6101.    InitPtr Ptr%(), Elements%
  6102.  
  6103. Ptr%()      array to initialize
  6104. Elements%   number of elements to initialize
  6105. -------
  6106. Ptr%()      initialized array
  6107.  
  6108. Name  : InsChr               (Insert Character)
  6109. Class : Display
  6110. Level : Clone
  6111.  
  6112. The InsChr routine inserts a space at the specified screen
  6113. location.
  6114.  
  6115.    InsChr Row%, Column%
  6116.  
  6117. Row%      row of character
  6118. Column%   column of character
  6119.  
  6120. Name  : InsLine              (Insert Line)
  6121. Class : Display
  6122. Level : BIOS
  6123.  
  6124. This routine inserts a blank line at the specified row of the
  6125. screen.
  6126.  
  6127.    InsLine Row%, VAttr%
  6128.  
  6129. Row%      row to insert
  6130. VAttr%    color/attribute to use on new row (see CalcAttr)
  6131.  
  6132. Name  : Int2Date             (Integer to Date)
  6133. Class : Time
  6134. Level : Any
  6135.  
  6136. This routine undoes the results of the Date2Int routine.  It
  6137. expands a single integer into month, day, and year values.
  6138.  
  6139. The storage format is identical to that used by DOS for file
  6140. dates, by the way, so this routine makes an apt companion for
  6141. LoadDirFull.
  6142.  
  6143.  
  6144. See also Int2DateSt$, a version of this routine which returns a
  6145. string instead of numbers.
  6146.  
  6147.  
  6148.    Int2Date MonthNr%, DayNr%, YearNr%, IntDate%
  6149.  
  6150. IntDate%     date compressed into an integer
  6151. -------
  6152. MonthNr%     month number (1-12)
  6153. DayNr%       day (1-31)
  6154. YearNr%      year (1980-2079; see above for two-digit years)
  6155.  
  6156. Name  : Int2DateSt$          (Integer to Date String)
  6157. Class : Time
  6158. Level : Any
  6159.  
  6160. This routine undoes the results of the Date2Int routine.  It
  6161. expands a single integer into a date string with the format
  6162. MM-DD-YYYY.
  6163.  
  6164. The storage format is identical to that used by DOS for file
  6165. dates, by the way, so this routine makes an apt companion for
  6166. LoadDirFull.
  6167.  
  6168. See also Int2Date, a version of this routine which returns
  6169. month, day, and year numbers instead of a string.
  6170.  
  6171.  
  6172.    DateSt$ = Int2DateSt$(IntDate%)
  6173.  
  6174. IntDate%     date compressed into an integer
  6175. -------
  6176. DateSt$      uncompressed date in MM-DD-YYYY format.
  6177.  
  6178. Name  : Int2Time             (Integer to Time)
  6179. Class : Time
  6180. Level : Any
  6181.  
  6182. This routine undoes the results of the Time2Int routine.  It
  6183. expands a single integer into hour, minute, and second values.
  6184.  
  6185. Note that the seconds will always be even, due to the storage
  6186. format.  The storage format is identical to that used by DOS
  6187. for file times, by the way, so this routine makes an apt
  6188. companion for LoadDirFull.
  6189.  
  6190. See also Int2TimeSt$, a version of this routine which returns a
  6191. string instead of numbers.
  6192.  
  6193.    Int2Time HourNr%, MinuteNr%, SecondNr%, IntTime%
  6194.  
  6195. IntTime%     time compressed into an integer
  6196. -------
  6197. HourNr%      hour (0-23)
  6198. MinuteNr%    minute
  6199. SecondNr%    second
  6200.  
  6201. Name  : Int2TimeSt$          (Integer to Time String)
  6202. Class : Time
  6203. Level : Any
  6204.  
  6205. This routine undoes the results of the Time2Int routine.  It
  6206. expands a single integer into hour, minute, and second values.
  6207.  
  6208. Note that the seconds will always be even, due to the storage
  6209. format.  The storage format is identical to that used by DOS
  6210. for file times, by the way, so this routine makes an apt
  6211. companion for LoadDirFull.
  6212.  
  6213. See also Int2Time, a version of this routine which returns
  6214. hour, minute, and second numbers instead of a string.
  6215.  
  6216.    TimeSt$ = Int2TimeSt$(IntTime%)
  6217.  
  6218. IntTime%     time compressed into an integer
  6219. -------
  6220. TimeSt$      uncompressed time in HH:MM:SS format
  6221.  
  6222. Name  : IntVector            (Interrupt Vector)
  6223. Class : Miscellaneous
  6224. Level : DOS
  6225.  
  6226. The IntVector routine retrieves the address of a specified
  6227. interrupt handler. If there is no interrupt handler, the
  6228. results will normally be zero, although early DOS versions did
  6229. not always have the sense to initialize unused vectors that way.
  6230.  
  6231.    IntVector DSeg%, DOfs%, Interrupt%
  6232.  
  6233. Interrupt%   interrupt number to examine
  6234. -------
  6235. DSeg%        segment of the interrupt handler
  6236. DOfs%        offset of the interrupt handler
  6237.  
  6238. Name  : IRead                (Integer Read)
  6239. Class : Disk
  6240. Level : DOS
  6241.  
  6242. This routine reads an integer (two binary bytes) from a file.
  6243. For some applications, you might prefer LIRead, which reads an
  6244. integer from a file into a zero-extended long integer-- which
  6245. essentially provides support for unsigned integers (0-65535).
  6246.  
  6247. The file must have been opened using FCreate or FOpen1.
  6248.  
  6249.    IRead Handle%, Value%, ErrCode%
  6250.  
  6251. Handle%    file handle
  6252. -------
  6253. Value%     integer read from file
  6254. ErrCode%   DOS error code (0 if no error)
  6255.  
  6256. Name  : IsAlNum%             (Is Alphanumeric?)
  6257. Class : String
  6258. Level : Any
  6259.  
  6260. This function returns whether a character is alphabetic or
  6261. numeric.
  6262.  
  6263. Functions in this family include:
  6264.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6265.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6266.  
  6267.    IsIt% = IsAlNum%(Ch$)
  6268.  
  6269. Ch$       character to check
  6270. -------
  6271. IsIt%     -1 if the character is alphabetic or numeric
  6272.  
  6273. Name  : IsAlpha%             (Is Alphabetic?)
  6274. Class : String
  6275. Level : Any
  6276.  
  6277. This function returns whether a character is alphabetic.
  6278.  
  6279. Functions in this family include:
  6280.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6281.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6282.  
  6283.    IsIt% = IsAlpha%(Ch$)
  6284.  
  6285. Ch$       character to check
  6286. -------
  6287. IsIt%     -1 if the character is alphabetic
  6288.  
  6289. Name  : IsASCII%             (Is ASCII?)
  6290. Class : String
  6291. Level : Any
  6292.  
  6293. This function returns whether a character is ASCII.  This is
  6294. true if the character ranges from CHR$(0)-CHR$(127).
  6295.  
  6296. Functions in this family include:
  6297.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6298.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6299.  
  6300.    IsIt% = IsASCII%(Ch$)
  6301.  
  6302. Ch$       character to check
  6303. -------
  6304. IsIt%     -1 if the character is ASCII
  6305.  
  6306. Name  : IsCntrl%             (Is Control?)
  6307. Class : String
  6308. Level : Any
  6309.  
  6310. This function returns whether a character is a control code.
  6311. This is true for CHR$(0)-CHR$(32) and CHR$(127).
  6312.  
  6313. Functions in this family include:
  6314.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6315.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6316.  
  6317.    IsIt% = IsCntrl%(Ch$)
  6318.  
  6319. Ch$       character to check
  6320. -------
  6321. IsIt%     -1 if the character is a control code
  6322.  
  6323. Name  : IsDigit%             (Is Digit?)
  6324. Class : String
  6325. Level : Any
  6326.  
  6327. This function returns whether a character is numeric.
  6328.  
  6329. Functions in this family include:
  6330.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6331.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6332.  
  6333.    IsIt% = IsDigit%(Ch$)
  6334.  
  6335. Ch$       character to check
  6336. -------
  6337. IsIt%     -1 if the character is a digit
  6338.  
  6339. Name  : IsLower%             (Is Lowercase?)
  6340. Class : String
  6341. Level : Any
  6342.  
  6343. This function returns whether a character is a lowercase
  6344. letter.
  6345.  
  6346. Functions in this family include:
  6347.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6348.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6349.  
  6350.    IsIt% = IsLower%(Ch$)
  6351.  
  6352. Ch$       character to check
  6353. -------
  6354. IsIt%     -1 if the character is a lowercase letter
  6355.  
  6356. Name  : IsPrint%             (Is Printable?)
  6357. Class : String
  6358. Level : Any
  6359.  
  6360. This function returns whether a character is printable.  This
  6361. is true for CHR$(32)-CHR$(126).
  6362.  
  6363. Functions in this family include:
  6364.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6365.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6366.  
  6367.    IsIt% = IsPrint%(Ch$)
  6368.  
  6369. Ch$       character to check
  6370. -------
  6371. IsIt%     -1 if the character is printable
  6372.  
  6373. Name  : IsPunct%             (Is Punctuation?)
  6374. Class : String
  6375. Level : Any
  6376.  
  6377. This function returns whether a character is punctuation.  This
  6378. is true for any ASCII character that is not alphabetic,
  6379. numeric, or a control code.
  6380.  
  6381. Functions in this family include:
  6382.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6383.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6384.  
  6385.    IsIt% = IsPunct%(Ch$)
  6386.  
  6387. Ch$       character to check
  6388. -------
  6389. IsIt%     -1 if the character is punctuation
  6390.  
  6391. Name  : IsSpace%             (Is Space?)
  6392. Class : String
  6393. Level : Any
  6394.  
  6395. This function returns whether a character is white space.  This
  6396. includes Space, Carriage Return, Horizontal Tab, Vertical Tab,
  6397. LineFeed, and FormFeed characters.
  6398.  
  6399. Functions in this family include:
  6400.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6401.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6402.  
  6403.    IsIt% = IsSpace%(Ch$)
  6404.  
  6405. Ch$       character to check
  6406. -------
  6407. IsIt%     -1 if the character is white space
  6408.  
  6409. Name  : IStr$                (Integer STR$)
  6410. Class : String
  6411. Level : Any
  6412.  
  6413. This routine is identical to the BASIC function STR$, but is
  6414. somewhat smaller.  It is only for integer values.
  6415.  
  6416.    St$ = IStr$(Number%)
  6417.  
  6418. Number%   integer to convert
  6419. -------
  6420. St$       string form of the number
  6421.  
  6422. Name  : IsUpper%             (Is Uppercase?)
  6423. Class : String
  6424. Level : Any
  6425.  
  6426. This function returns whether a character is an uppercase
  6427. letter.
  6428.  
  6429. Functions in this family include:
  6430.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6431.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6432.  
  6433.    IsIt% = IsUpper%(Ch$)
  6434.  
  6435. Ch$       character to check
  6436. -------
  6437. IsIt%     -1 if the character is uppercase
  6438.  
  6439. Name  : IsXDigit%            (Is Hex Digit?)
  6440. Class : String
  6441. Level : Any
  6442.  
  6443. Functions in this family include:
  6444.    IsAlNum, IsAlpha, IsASCII, IsCntrl, IsDigit, IsLower,
  6445.    IsPrint, IsPunct, IsSpace, IsUpper, IsXDigit
  6446.  
  6447. This function returns whether a character is a hexadecimal
  6448. digit.
  6449.  
  6450.    IsIt% = IsXDigit%(Ch$)
  6451.  
  6452. Ch$       character to check
  6453. -------
  6454. IsIt%     -1 if the character is a hex digit
  6455.  
  6456. Name  : IVal%                (Integer VAL)
  6457. Class : Numeric
  6458. Level : Any
  6459.  
  6460. This routine is similar to the BASIC function VAL, but is much
  6461. faster.  If you are not using floating point numbers, this
  6462. routine may also decrease the size of your program
  6463. significantly, since it won't cause BASIC to pull in its
  6464. floating point routines as VAL does.
  6465.  
  6466. Unlike VAL, this routine only converts strings to integer
  6467. values.  It will not handle hex or octal strings.  It will not
  6468. notify you if there is an overflow error.  Finally, although
  6469. IVal% will ignore leading blanks, it assumes that a number may
  6470. not contain blanks, whereas VAL will ignore blanks in the
  6471. middle of a number:
  6472.  
  6473.      VAL("  12 34") returns 1234
  6474.    IVal%("  12 34") returns 12
  6475.  
  6476. Note that, like VAL (but unlike the IVal% function in ProBas),
  6477. multiple negation is considered illegal.  For example,
  6478. IVal%("--1") returns zero.
  6479.  
  6480.    Number% = IVal%(St$)
  6481.  
  6482. St$       string to convert
  6483. -------
  6484. Number%   integer form of string (0 if there isn't one)
  6485.  
  6486. Name  : IWrite               (Integer Write)
  6487. Class : Disk
  6488. Level : DOS
  6489.  
  6490. This routine writes an integer (two binary bytes) to a file.
  6491.  
  6492. The file must have been opened using FCreate or FOpen1.
  6493.  
  6494.    IWrite Handle%, Value%, ErrCode%
  6495.  
  6496. Handle%    file handle
  6497. Value%     integer to write to file
  6498. -------
  6499. ErrCode%   DOS error code (0 if no error)
  6500.  
  6501. Name  : KbdType              (Keyboard Type)
  6502. Class : Input / Equipment
  6503. Level : Clone
  6504.  
  6505. This routine tells you if an enhanced (101-key) keyboard is
  6506. available.
  6507.  
  6508. If KbdType is not entirely sure that an enhanced keyboard is
  6509. available, it plays safe and assumes there isn't one.  This
  6510. avoids possible disaster on older PCs.
  6511.  
  6512.    KbdType Enhanced%
  6513.  
  6514. -------
  6515. Enhanced%    whether keyboard is of the enhanced type (0 no)
  6516.  
  6517. Name  : KbdType2%            (Keyboard Type)
  6518. Class : Input / Equipment
  6519. Level : Clone
  6520.  
  6521. This routine tells you if an enhanced (101-key) keyboard is
  6522. available.
  6523.  
  6524. If KbdType2% is not entirely sure that an enhanced keyboard is
  6525. available, it plays safe and assumes there isn't one.  This
  6526. avoids possible disaster on older PCs.
  6527.  
  6528.    Enhanced% = KbdType2%
  6529.  
  6530. -------
  6531. Enhanced%    whether keyboard is of the enhanced type (0 no)
  6532.  
  6533. Name  : KeyPress             (detect Key Press)
  6534. Class : Input
  6535. Level : DOS
  6536.  
  6537. This routine works like the Turbo/Power BASIC function INSTAT.
  6538. It tells you whether there is a key waiting to be processed.
  6539.  
  6540.    KeyPress KeyHit%
  6541.  
  6542. -------
  6543. KeyHit%   whether a key is waiting (0 if no)
  6544.  
  6545. Name  : KVal&                (Kilobyte VAL)
  6546. Class : Numeric
  6547. Level : Any
  6548.  
  6549. This routine is similar to the BASIC function VAL, but is much
  6550. faster.  The number returned is divided by 1024, which is
  6551. useful if you're dealing in terms of kilobytes.  If you are not
  6552. using floating point numbers, this routine may decrease the
  6553. size of your program significantly, since it won't cause BASIC
  6554. to pull in its floating point routines as VAL does.
  6555.  
  6556. Unlike VAL, this routine only converts strings to long integer
  6557. values.  It will not handle hex or octal strings.  It will not
  6558. notify you if there is an overflow error.  Finally, although
  6559. KVal& will ignore leading blanks, it assumes that a number may
  6560. not contain blanks, whereas VAL will ignore blanks in the
  6561. middle of a number.
  6562.  
  6563. Note that, like VAL (but unlike the KVal& function in ProBas),
  6564. multiple negation is considered illegal.  For example,
  6565. KVal&("--10000") returns zero.
  6566.  
  6567.    Number& = KVal&(St$)
  6568.  
  6569. St$       string to convert
  6570. -------
  6571. Number&   long integer form of string, divided by 1024
  6572.  
  6573. Name  : LClose               (L/I/M Close)
  6574. Class : Memory
  6575. Level : BIOS
  6576.  
  6577. This routine closes a block of expanded memory that was opened
  6578. for access by LOpen.  It is important to close the block when
  6579. you are finished with it, to return it to the free memory pool.
  6580.  
  6581. Routines in this suite include: LOpen, LGet, LPut, LClose.
  6582.  
  6583.    LClose EMSHandle%
  6584.  
  6585. EMSHandle%    handle of the expanded memory block
  6586.  
  6587. Name  : LGet                 (L/I/M Get)
  6588. Class : Memory
  6589. Level : BIOS
  6590.  
  6591. This routine gets a block of data from expanded memory that was
  6592. opened for access by LOpen.  The amount of data is specified in
  6593. words; one word is the same as two bytes.  An integer takes up
  6594. a word, long integers and single precision numbers require two
  6595. words, and double precision numbers take four.
  6596.  
  6597. Routines in this suite include: LOpen, LGet, LPut, LClose.
  6598.  
  6599.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  6600.  
  6601. EMSHandle%    handle of the expanded memory block
  6602. DSeg%         segment of place to store data
  6603. DOfs%         offset of place to store data
  6604. Words%        words to get from expanded memory
  6605.  
  6606. Name  : LIRead               (Long Integer Read)
  6607. Class : Disk
  6608. Level : DOS
  6609.  
  6610. This routine reads an integer from a file into a long integer.
  6611. The integer is zero-extended into the long, providing effective
  6612. support for unsigned integers (a range of 0-65535).
  6613.  
  6614. The file must have been opened using FCreate or FOpen1.
  6615.  
  6616.    LIRead Handle%, Value&, ErrCode%
  6617.  
  6618. Handle%    file handle
  6619. -------
  6620. Value&     integer read from file
  6621. ErrCode%   DOS error code (0 if no error)
  6622.  
  6623. Name  : LIWrite              (Long Integer Write)
  6624. Class : Disk
  6625. Level : DOS
  6626.  
  6627. This routine writes an integer to a file from a long integer.
  6628. This makes it easier to support unsigned integers (with a range
  6629. of 0-65535).
  6630.  
  6631. The file must have been opened using FCreate or FOpen1.
  6632.  
  6633.    LIWrite Handle%, Value&, ErrCode%
  6634.  
  6635. Handle%    file handle
  6636. Value&     integer to write to file
  6637. -------
  6638. ErrCode%   DOS error code (0 if no error)
  6639.  
  6640. Name  : LoadDir              (Load Directory)
  6641. Class : Disk
  6642. Level : DOS
  6643.  
  6644. Given a filespec with wildcards and a file attribute, this
  6645. routine loads a list of all matching files into an array.  The
  6646. array must be of fixed-length string type, with 12 characters
  6647. for each filename.  You can find out how large to DIM the array
  6648. by using the FileCount routine.
  6649.  
  6650. The attribute can be any of the usual file attributes:
  6651.    1   Read-Only
  6652.    2   Hidden
  6653.    4   System
  6654.   16   Directory
  6655.  
  6656. You can combine attributes by adding their values.  For
  6657. instance, to search for hidden directories, you'd use an
  6658. attribute of 18.  By default, DOS returns normal files as well
  6659. as files which have the specified attributes, so an attribute
  6660. of 18 would get you normal files, hidden files, directories,
  6661. and hidden directories.  However, LoadDir can be made to screen
  6662. out unwanted files-- just negate the attribute to force only
  6663. files of that attribute to be counted.  For example, an
  6664. attribute of -18 would return only hidden subdirectories.
  6665.  
  6666. NOTE:  we use FilAttr%, not FileAttr%, because BASIC has an
  6667. internal function named FILEATTR.
  6668.  
  6669.    LoadDir FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  6670.  
  6671. FileSpec$    search file specification (may contain wildcards)
  6672. FilAttr%     search file attribute
  6673. DSeg%        segment of array (use VARSEG)
  6674. DOfs%        offset of array (use VARPTR)
  6675. -------
  6676. ErrCode%     error code (0 if no error)
  6677.  
  6678. Name  : LoadDirAll           (Load Directory, All info)
  6679. Class : Disk
  6680. Level : DOS
  6681.  
  6682. Given a filespec with wildcards and a file attribute, this
  6683. routine loads a list of all matching files into an array.  All
  6684. available information about the file is included: name, size,
  6685. time, date, and attribute.  The array must be of the TYPE shown
  6686. below.  You can find out how large to DIM the array by using
  6687. the FileCount routine.
  6688.  
  6689.    TYPE DirType
  6690.       FilAttr AS STRING * 1
  6691.       FilTime AS INTEGER
  6692.       FilDate AS INTEGER
  6693.       FilSize AS LONG
  6694.       FilName AS STRING * 12
  6695.    END TYPE
  6696.  
  6697. You can change the names if you like, but don't alter the order
  6698. of the information.  You can decode the file attribute with the
  6699. ASC function, then process it with ExplainFAttr$.  The file
  6700. time and date can be decoded with the Int2Time and Int2Date or
  6701. Int2TimeSt$ and Int2DateSt$ routines.
  6702.  
  6703. The attribute can be any of the usual file attributes:
  6704.    1   Read-Only
  6705.    2   Hidden
  6706.    4   System
  6707.   16   Directory
  6708.  
  6709. You can combine attributes by adding their values.  For
  6710. instance, to search for hidden directories, you'd use an
  6711. attribute of 18.  By default, DOS returns normal files as well
  6712. as files which have the specified attributes, so an attribute
  6713. of 18 would get you normal files, hidden files, directories,
  6714. and hidden directories.  However, LoadDir can be made to screen
  6715. out unwanted files-- just negate the attribute to force only
  6716. files of that attribute to be counted.  For example, an
  6717. attribute of -18 would return only hidden subdirectories.
  6718.  
  6719. NOTE:  we use FilAttr%, not FileAttr%, because BASIC has an
  6720. internal function named FILEATTR.
  6721.  
  6722.    LoadDir FileSpec$, FilAttr%, DSeg%, DOfs%, ErrCode%
  6723.  
  6724. FileSpec$    search file specification (may contain wildcards)
  6725. FilAttr%     search file attribute
  6726. DSeg%        segment of array (use VARSEG)
  6727. DOfs%        offset of array (use VARPTR)
  6728. -------
  6729. ErrCode%     error code (0 if no error)
  6730.  
  6731. Name  : LoByte%              (Low Byte)
  6732. Class : Numeric
  6733. Level : Any
  6734.  
  6735. This function returns the low byte of an integer.
  6736.  
  6737.    Byte% = LoByte%(Nr%)
  6738.  
  6739. Nr%        integer
  6740. -------
  6741. Byte%      value of the least significant byte
  6742.  
  6743. Name  : Locase               (Lowercase)
  6744. Class : String
  6745. Level : Any
  6746.  
  6747. This routine, like BASIC's LCASE$ function, converts a string
  6748. to lowercase. Since it doesn't have to create a new return
  6749. string (a fairly slow process), it's faster than the BASIC
  6750. equivalent.
  6751.  
  6752. See also Locase1.
  6753.  
  6754.    Locase St$
  6755.  
  6756. St$     string to be put into lowercase
  6757. -------
  6758. St$     lowercase string
  6759.  
  6760. Name  : Locase1              (Lowercase)
  6761. Class : String
  6762. Level : Any
  6763.  
  6764. This routine, like BASIC's LCASE$ function, converts a string
  6765. to lowercase. It converts letters in the extended character set
  6766. as well as the usual letters, making it well suited for text
  6767. which may not be in English.
  6768.  
  6769. Note that DOS 5.0 and later versions provide National Language
  6770. Support which includes conversion to uppercase (not lowercase,
  6771. unfortunately).  So, if you merely need the characters in a
  6772. known state, rather than lowercase, you would do better to use
  6773. the Upcase1 routine.  Locase1 assumes the U.S. character set,
  6774. which may well not be appropriate.
  6775.  
  6776. See also Locase.
  6777.  
  6778.    Locase1 St$
  6779.  
  6780. St$     string to be put into lowercase
  6781. -------
  6782. St$     lowercase string
  6783.  
  6784. Name  : LogicalDrives%       (Logical Drives)
  6785. Class : Disk / Equipment
  6786. Level : DOS
  6787.  
  6788. This function returns the number of logical drives available.
  6789.  
  6790. A logical drive corresponds roughly to a drive letter-- it may
  6791. point to zero or more actual devices.  For instance, on a
  6792. one-floppy system, both A: and B: point to the same drive.  On
  6793. a partitioned hard drive, both C: and D: may point to different
  6794. areas of the same drive.  Drive E: may point to a RAMdisk, or
  6795. maybe it doesn't point to anything at all.
  6796.  
  6797. As you can see, knowing the number of logical drives doesn't
  6798. tell you much about what's actually there.  However, it does
  6799. give you an upper limit on the number of drive letters
  6800. available, which is a good place to start.
  6801.  
  6802.    Drives% = LogicalDrives%
  6803.  
  6804. -------
  6805. Drives%    number of logical drives
  6806.  
  6807. Name  : LOpen                (L/I/M Open)
  6808. Class : Memory
  6809. Level : BIOS
  6810.  
  6811. This routine opens a block of expanded memory for access.  The
  6812. size of the block is specified in words; one word is the same
  6813. as two bytes.  An integer takes up a word, long integers and
  6814. single precision numbers require two words, and double
  6815. precision numbers take four.  This allows you to store up to
  6816. 64K in each EMS block that you open.
  6817.  
  6818. Note that LOpen expects an EMS driver to be available.  If you
  6819. are not certain on this point, use GetLIMM beforehand to make
  6820. sure.
  6821.  
  6822. Routines in this suite include: LOpen, LGet, LPut, LClose.
  6823.  
  6824.    LOpen Words%, EMSHandle%, ErrCode%
  6825.  
  6826. Words%        size of expanded memory block to allocate
  6827. -------
  6828. EMSHandle%    handle of the expanded memory block
  6829. ErrCode%      error code (0 if no error)
  6830.  
  6831. Name  : LoWord%              (Low Word)
  6832. Class : Numeric
  6833. Level : Any
  6834.  
  6835. This function returns the low word of a long integer.
  6836.  
  6837.    Word% = LoWord%(Nr&)
  6838.  
  6839. Nr&        long integer
  6840. -------
  6841. Word%      value of the least significant word
  6842.  
  6843. Name  : LPut                 (L/I/M Put)
  6844. Class : Memory
  6845. Level : BIOS
  6846.  
  6847. This routine puts a block of data into expanded memory that was
  6848. opened for access by LOpen.  The amount of data is specified in
  6849. words; one word is the same as two bytes.  An integer takes up
  6850. a word, long integers and single precision numbers require two
  6851. words, and double precision numbers take four.
  6852.  
  6853. Routines in this suite include: LOpen, LGet, LPut, LClose.
  6854.  
  6855.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  6856.  
  6857. EMSHandle%    handle of the expanded memory block
  6858. DSeg%         segment of place from which to get data
  6859. DOfs%         offset of place from which to get data
  6860. Words%        words to put into expanded memory
  6861.  
  6862. Name  : LRead                (Long Read)
  6863. Class : Disk
  6864. Level : DOS
  6865.  
  6866. This routine reads a long integer (four binary bytes) from a
  6867. file.
  6868.  
  6869. The file must have been opened using FCreate or FOpen1.
  6870.  
  6871.    LRead Handle%, Value&, ErrCode%
  6872.  
  6873. Handle%    file handle
  6874. -------
  6875. Value&     long integer read from file
  6876. ErrCode%   DOS error code (0 if no error)
  6877.  
  6878. Name  : LRotate              (Left Rotate)
  6879. Class : String
  6880. Level : Any
  6881.  
  6882. Many years ago, I wrote one of the first terminal programs for
  6883. the PC.  It died a horrible death when Qmodem came out...
  6884. sigh.  This routine comes from that experience.  It rotates the
  6885. characters in a string left once (e.g., "ABCDE" becomes
  6886. "BCDEA").  I used this in my routine to dial a list of BBSes,
  6887. skipping to the next one if the current one was busy.
  6888.  
  6889. LRotate can also be handy for things like scrolling a long
  6890. message across the screen (you just PRINT LEFT$(Message$, 80);
  6891. then delay a bit, LRotate and do it again).
  6892.  
  6893. See also RRotate.
  6894.  
  6895.    LRotate St$
  6896.  
  6897. St$     string to be rotated left once
  6898. -------
  6899. St$     string after being rotated left once
  6900.  
  6901. Name  : LScroll              (Left Scroll)
  6902. Class : Display
  6903. Level : Clone
  6904.  
  6905. This routine scrolls any selected part of the display left.
  6906. You may scroll as many times as you like, or scroll "zero"
  6907. times to totally clear the selected part of the display.
  6908.  
  6909.    LScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  6910.  
  6911. TopRow%      top row of the area to scroll
  6912. LeftCol%     left column of the area to scroll
  6913. BottomRow%   top row of the area to scroll
  6914. RightCol%    left column of the area to scroll
  6915. Times%       number of times (or rows) to scroll
  6916.  
  6917. Name  : LVal&                (Long integer VAL)
  6918. Class : Numeric
  6919. Level : Any
  6920.  
  6921. This routine is similar to the BASIC function VAL, but is much
  6922. faster.  If you are not using floating point numbers, this
  6923. routine may also decrease the size of your program
  6924. significantly, since it won't cause BASIC to pull in its
  6925. floating point routines as VAL does.
  6926.  
  6927. Unlike VAL, this routine only converts strings to long integer
  6928. values.  It will not handle hex or octal strings.  It will not
  6929. notify you if there is an overflow error.  Finally, although
  6930. LVal& will ignore leading blanks, it assumes that a number may
  6931. not contain blanks, whereas VAL will ignore blanks in the
  6932. middle of a number:
  6933.  
  6934.      VAL("  12 34") returns 1234
  6935.    LVal&("  12 34") returns 12
  6936.  
  6937. Note that, like VAL (but unlike the LVal& function in ProBas),
  6938. multiple negation is considered illegal.  For example,
  6939. LVal&("--1") returns zero.
  6940.  
  6941.    Number& = LVal&(St$)
  6942.  
  6943. St$       string to convert
  6944. -------
  6945. Number&   long integer form of string (0 if there isn't one)
  6946.  
  6947. Name  : LWrite               (Long Write)
  6948. Class : Disk
  6949. Level : DOS
  6950.  
  6951. This routine writes a long integer to a file.
  6952.  
  6953. The file must have been opened using FCreate or FOpen1.
  6954.  
  6955.    LWrite Handle%, Value&, ErrCode%
  6956.  
  6957. Handle%    file handle
  6958. Value&     long integer to write to file
  6959. -------
  6960. ErrCode%   DOS error code (0 if no error)
  6961.  
  6962. Name  : MakeSub              (Make Subdirectory)
  6963. Class : Disk
  6964. Level : DOS
  6965.  
  6966. Like the DOS MD (or MKDIR) command, this routine creates a new
  6967. subdirectory.
  6968.  
  6969.    MakeSub SubDir$, ErrCode%
  6970.  
  6971. SubDir$    name of new subdirectory
  6972. -------
  6973. ErrCode%   error code: 0 if none, else DOS Error
  6974.  
  6975. Name  : MatchFile            (Match File)
  6976. Class : Disk / String
  6977. Level : Any
  6978.  
  6979. The MatchFile routine tells you whether a given filename
  6980. matches a file specification which may contain wildcards.  The
  6981. filename itself should not contain wildcards.  Neither the
  6982. filename nor filespec should include drive or subdirectory
  6983. specifications.
  6984.  
  6985. One way of using this is in processing file exclusion lists.
  6986. The FindFirstF routine allows you to find files that match a
  6987. given filespec; to this, you could add a MatchFile-based
  6988. routine which would screen out files that match a different
  6989. filespec.  Such a routine would allow you to create utilities
  6990. to do things like "DIR *.* /EXCEPT=*.BAS".
  6991.  
  6992.    MatchFile FileSpec$, FileName$, IsMatch%
  6993.  
  6994. FileSpec$   master file pattern (may contain wildcards)
  6995. FileName$   name of file to test against the master pattern
  6996. -------
  6997. IsMatch%    0 if the filename doesn't match the filespec
  6998.  
  6999. Name  : Max%                 (Maximum)
  7000. Class : Numeric
  7001. Level : Any
  7002.  
  7003. This function returns the larger of two integers.  It can be
  7004. handy in sorting routines or for keeping a value within a
  7005. desired range.
  7006.  
  7007.    Larger% = Max%(First%, Second%)
  7008.  
  7009. First%     one integer
  7010. Second%    another integer
  7011. -------
  7012. Larger%    larger of the two integers
  7013.  
  7014. Name  : MaxD#                (Maximum Double precision)
  7015. Class : Numeric
  7016. Level : Any
  7017.  
  7018. This function returns the larger of two double-precision
  7019. numbers.  It can be handy in sorting routines or for keeping a
  7020. value within a desired range.
  7021.  
  7022.    Larger# = MaxD#(First#, Second#)
  7023.  
  7024. First#     one number
  7025. Second#    another number
  7026. -------
  7027. Larger#    larger of the two numbers
  7028.  
  7029. Name  : MaxL&                (Maximum Long integer)
  7030. Class : Numeric
  7031. Level : Any
  7032.  
  7033. This function returns the larger of two long integers.  It can
  7034. be handy in sorting routines or for keeping a value within a
  7035. desired range.
  7036.  
  7037.    Larger& = MaxL&(First&, Second&)
  7038.  
  7039. First&     one long integer
  7040. Second&    another long integer
  7041. -------
  7042. Larger&    larger of the two long integers
  7043.  
  7044. Name  : MaxS!                (Maximum Single precision)
  7045. Class : Numeric
  7046. Level : Any
  7047.  
  7048. This function returns the larger of two single-precision
  7049. numbers.  It can be handy in sorting routines or for keeping a
  7050. value within a desired range.
  7051.  
  7052.    Larger! = MaxS!(First!, Second!)
  7053.  
  7054. First!     one number
  7055. Second!    another number
  7056. -------
  7057. Larger!    larger of the two numbers
  7058.  
  7059. Name  : MeanAverageD         (Mean Average Double precision)
  7060. Class : Array management
  7061. Level : Any
  7062.  
  7063. This routine averages the specified range of elements in an
  7064. array of double precision numbers.  The form of averaging used
  7065. is called the "mean", which is the sum of all of the elements
  7066. divided by the number of elements involved. This is the most
  7067. common method of averaging a list of numbers.
  7068.  
  7069.    MeanAverageD Array#(), First%, Last%, Average#, ErrCode%
  7070.  
  7071. Array#()    array to be averaged
  7072. First%      array element to start with
  7073. Last%       array element to end with
  7074. -------
  7075. Average#    average value of the specified elements
  7076. ErrCode%    0 if there was no error
  7077.  
  7078. Name  : MeanAverageI         (Mean Average Integer)
  7079. Class : Array management
  7080. Level : Any
  7081.  
  7082. This routine averages the specified range of elements in an
  7083. array of integer numbers.  The form of averaging used is called
  7084. the "mean", which is the sum of all of the elements divided by
  7085. the number of elements involved. This is the most common method
  7086. of averaging a list of numbers.
  7087.  
  7088.    MeanAverageI Array%(), First%, Last%, Average%, ErrCode%
  7089.  
  7090. Array()     array to be averaged
  7091. First%      array element to start with
  7092. Last%       array element to end with
  7093. -------
  7094. Average%    average value of the specified elements
  7095. ErrCode%    0 if there was no error
  7096.  
  7097. Name  : MeanAverageL         (Mean Average Long integer)
  7098. Class : Array management
  7099. Level : Any
  7100.  
  7101. This routine averages the specified range of elements in an
  7102. array of long integer numbers.  The form of averaging used is
  7103. called the "mean", which is the sum of all of the elements
  7104. divided by the number of elements involved. This is the most
  7105. common method of averaging a list of numbers.
  7106.  
  7107.    MeanAverageL Array&(), First%, Last%, Average&, ErrCode%
  7108.  
  7109. Array&()    array to be averaged
  7110. First%      array element to start with
  7111. Last%       array element to end with
  7112. -------
  7113. Average&    average value of the specified elements
  7114. ErrCode%    0 if there was no error
  7115.  
  7116. Name  : MeanAverageS         (Mean Average Single precision)
  7117. Class : Array management
  7118. Level : Any
  7119.  
  7120. This routine averages the specified range of elements in an
  7121. array of single precision numbers.  The form of averaging used
  7122. is called the "mean", which is the sum of all of the elements
  7123. divided by the number of elements involved. This is the most
  7124. common method of averaging a list of numbers.
  7125.  
  7126.    MeanAverageS Array!(), First%, Last%, Average!, ErrCode%
  7127.  
  7128. Array!()    array to be averaged
  7129. First%      array element to start with
  7130. Last%       array element to end with
  7131. -------
  7132. Average!    average value of the specified elements
  7133. ErrCode%    0 if no error
  7134.  
  7135. Name  : MemSwap              (Memory Swap)
  7136. Class : Memory
  7137. Level : Any
  7138.  
  7139. MemSwap swaps the contents of one area of memory with another.
  7140. This can be used for a variety of things, from swapping a saved
  7141. screen with the actual screen to exchanging the contents of two
  7142. arrays.
  7143.  
  7144.    MemSwap DSeg1%, DOfs1%, DSeg2%, DOfs2%, Bytes%
  7145.  
  7146. DSeg1%     segment of first memory area
  7147. DOfs1%     offset of first memory area
  7148. DSeg2%     segment of second memory area
  7149. DOfs2%     offset of second memory area
  7150. Bytes%     bytes to swap
  7151.  
  7152. Name  : Min%                 (Minimum)
  7153. Class : Numeric
  7154. Level : Any
  7155.  
  7156. This function returns the smaller of two integers.  It can be
  7157. handy in sorting routines or for keeping a value within a
  7158. desired range.
  7159.  
  7160.    Smaller% = Min%(First%, Second%)
  7161.  
  7162. First%     one integer
  7163. Second%    another integer
  7164. -------
  7165. Smaller%   smaller of the two integers
  7166.  
  7167. Name  : MinD#                (Minimum Double precision)
  7168. Class : Numeric
  7169. Level : Any
  7170.  
  7171. This function returns the smaller of two double-precision
  7172. numbers.  It can be handy in sorting routines or for keeping a
  7173. value within a desired range.
  7174.  
  7175.    Smaller# = MinD#(First#, Second#)
  7176.  
  7177. First#     one number
  7178. Second#    another number
  7179. -------
  7180. Smaller#   smaller of the two numbers
  7181.  
  7182. Name  : MinL&                (Minimum Long integer)
  7183. Class : Numeric
  7184. Level : Any
  7185.  
  7186. This function returns the smaller of two long integers.  It can
  7187. be handy in sorting routines or for keeping a value within a
  7188. desired range.
  7189.  
  7190.    Smaller& = MinL&(First&, Second&)
  7191.  
  7192. First&     one long integer
  7193. Second&    another long integer
  7194. -------
  7195. Smaller&   smaller of the two long integers
  7196.  
  7197. Name  : MinS!                (Minimum Single precision)
  7198. Class : Numeric
  7199. Level : Any
  7200.  
  7201. This function returns the smaller of two single-precision
  7202. numbers.  It can be handy in sorting routines or for keeping a
  7203. value within a desired range.
  7204.  
  7205.    Smaller! = MinS!(First!, Second!)
  7206.  
  7207. First!     one number
  7208. Second!    another number
  7209. -------
  7210. Smaller!   smaller of the two numbers
  7211.  
  7212. Name  : MMButton             (Mouse Button)
  7213. Class : Mouse
  7214. Level : BIOS
  7215.  
  7216. The MMButton routine allows you to find out which mouse buttons
  7217. are pressed. Although it will work with any mouse, it is
  7218. designed specifically for a mouse with two buttons (see also
  7219. MMButton3).  If you want to find out which buttons were pressed
  7220. in the past, rather than being pressed now, try MMClick instead.
  7221.  
  7222. This routine will not work properly if there is no mouse
  7223. available.  Use the MMCheck routine if you are not sure.
  7224.  
  7225.    MMButton LeftB%, RightB%
  7226.  
  7227. -------
  7228. LeftB%     whether the left button is pressed
  7229. RightB%    whether the right button is pressed
  7230.  
  7231. Name  : MMButton3            (Mouse Button for 3-button mouse)
  7232. Class : Mouse
  7233. Level : BIOS
  7234.  
  7235. The MMButton3 routine allows you to find out which mouse
  7236. buttons are pressed. Although it will work with any mouse, it
  7237. is designed specifically for a mouse with three buttons (see
  7238. also MMButton).  If you want to find out which buttons were
  7239. pressed in the past, rather than being pressed now, try
  7240. MMClick3 instead.
  7241.  
  7242. This routine will not work properly if there is no mouse
  7243. available.  Use the MMCheck routine if you are not sure.
  7244.  
  7245.    MMButton3 LeftB%, MiddleB%, RightB%
  7246.  
  7247. -------
  7248. LeftB%     whether the left button is pressed
  7249. MiddleB%   whether the middle button is pressed
  7250. RightB%    whether the right button is pressed
  7251.  
  7252. Name  : MMCheck              (Mouse Check and initialize)
  7253. Class : Mouse
  7254. Level : BIOS
  7255.  
  7256. This routine does a number of things.  Primarily, it is
  7257. intended to let you check to see if a mouse is available.  It
  7258. returns a zero if there is no mouse; if there is a mouse, the
  7259. number of mouse buttons is returned.  The mouse status is also
  7260. initialized, so this is best used once at the beginning of your
  7261. program.
  7262.  
  7263. All of the other mouse routines assume that a mouse is
  7264. available, so you should definitely use MMCheck if you're not
  7265. sure.  Otherwise, results will be unusual at best, and the
  7266. computer may even lock up under some DOS versions.
  7267.  
  7268.    MMCheck Buttons%
  7269.  
  7270. -------
  7271. Buttons%   number of mouse buttons (0 if no mouse is installed)
  7272.  
  7273. Name  : MMClick              (Mouse Click)
  7274. Class : Mouse
  7275. Level : BIOS
  7276.  
  7277. The MMClick routine allows you to find out which mouse buttons
  7278. have been pressed since you last checked, and how many times
  7279. they were pressed. Although it will work with any mouse, it is
  7280. designed specifically for a mouse with two buttons (see also
  7281. MMClick3).  If you want to find out which buttons are currently
  7282. being pressed, try MMButton instead.
  7283.  
  7284. This routine will not work properly if there is no mouse
  7285. available.  Use the MMCheck routine if you are not sure.
  7286.  
  7287.    MMClick LeftB%, RightB%
  7288.  
  7289. -------
  7290. LeftB%     # of times left button was pressed since last check
  7291. RightB%    # of times right button was pressed since last check
  7292.  
  7293. Name  : MMClick3             (Mouse Click for 3-button mouse)
  7294. Class : Mouse
  7295. Level : BIOS
  7296.  
  7297. The MMClick3 routine allows you to find out which mouse buttons
  7298. have been pressed since you last checked, and how many times
  7299. they were pressed. Although it will work with any mouse, it is
  7300. designed specifically for a mouse with three buttons (see also
  7301. MMClick).  If you want to find out which buttons are currently
  7302. being pressed, try MMButton3 instead.
  7303.  
  7304. This routine will not work properly if there is no mouse
  7305. available.  Use the MMCheck routine if you are not sure.
  7306.  
  7307.    MMClick3 LeftB%, MiddleB%, RightB%
  7308.  
  7309. -------
  7310. LeftB%     # of times left button was pressed since last check
  7311. MiddleB%   # of times middle button was pressed since last look
  7312. RightB%    # of times right button was pressed since last check
  7313.  
  7314. Name  : MMCursorOff          (Mouse Cursor Off)
  7315. Class : Mouse
  7316. Level : BIOS
  7317.  
  7318. This routine makes the mouse cursor invisible.  The mouse
  7319. cursor will still function as a location indicator, in the same
  7320. way that the normal cursor still functions when you make it
  7321. invisible.
  7322.  
  7323. Note that the mouse cursor is somewhat bizarre in that an
  7324. "invisibility level" is kept.  Every time you use MMCursorOff,
  7325. the invisibility depth is increased; subsequent attempts to
  7326. make the cursor visible will not actually do so until the
  7327. invisibility depth reaches zero.  In other words, if you call
  7328. MMCursorOff when the cursor is already invisible, the cursor
  7329. will not reappear until you've told it to reappear as many
  7330. times as you told it to disappear.  This is fairly demented,
  7331. but that's the way Microsoft made it.
  7332.  
  7333. This routine will not work properly if no mouse is installed.
  7334. See MMCheck.
  7335.  
  7336.    MMCursorOff
  7337.  
  7338. Name  : MMCursorOn           (Mouse Cursor On)
  7339. Class : Mouse
  7340. Level : BIOS
  7341.  
  7342. This routine makes the mouse cursor visible, or tries to do
  7343. so...
  7344.  
  7345. The mouse cursor is somewhat bizarre in that an "invisibility
  7346. level" is kept.  Every time you use MMCursorOff, the
  7347. invisibility depth is increased; subsequent attempts to make
  7348. the cursor visible will not actually do so until the
  7349. invisibility depth reaches zero.  In other words, if you call
  7350. MMCursorOff when the cursor is already invisible, the cursor
  7351. will not reappear until you've told it to reappear (with
  7352. MMCursorOn) as many times as you told it to disappear.  This is
  7353. fairly demented, but that's the way Microsoft made it.
  7354.  
  7355. This routine will not work properly if no mouse is installed.
  7356. See MMCheck.
  7357.  
  7358.    MMCursorOn
  7359.  
  7360. Name  : MMGetLoc             (Mouse Get Location)
  7361. Class : Mouse
  7362. Level : BIOS
  7363.  
  7364. This routine allows you to get the current location of the
  7365. mouse cursor.  It doesn't matter if the cursor is visible or
  7366. invisible.
  7367.  
  7368. The mouse cursor location is somewhat perverse in CGA and text
  7369. modes, due to the sloppy design of Microsoft's original mouse
  7370. driver.  In text modes and both CGA graphics modes, the cursor
  7371. is returned as if the screen is 640x200. To correct this for
  7372. SCREEN 1, divide the X coordinate by two.  To correct this for
  7373. text modes, divide each coordinate by eight.
  7374.  
  7375. This routine will not work properly if there is no mouse
  7376. available.  Use the MMCheck routine if you are not sure.
  7377.  
  7378. See also GetMouseLoc, which returns the appropriate coordinates
  7379. for text mode.
  7380.  
  7381.    MMGetLoc X%, Y%
  7382.  
  7383. -------
  7384. X%         X coordinate ("column")
  7385. Y%         Y coordinate ("row")
  7386.  
  7387. Name  : MMSetLoc             (Mouse Set Location)
  7388. Class : Mouse
  7389. Level : BIOS
  7390.  
  7391. This routine allows you to set the current location of the
  7392. mouse cursor.  It doesn't matter if the cursor is visible or
  7393. invisible.
  7394.  
  7395. The mouse cursor location is somewhat perverse in CGA and text
  7396. modes, due to the sloppy design of Microsoft's original mouse
  7397. driver.  In text modes and both CGA graphics modes, the cursor
  7398. is returned as if the screen is 640x200. To correct this for
  7399. SCREEN 1, double the X coordinate.  To correct this for text
  7400. modes, multiply each coordinate by eight and add four.
  7401.  
  7402. This routine will not work properly if there is no mouse
  7403. available.  Use the MMCheck routine if you are not sure.
  7404.  
  7405. See also SetMouseLoc, which does the coordinate conversions for
  7406. you in text mode.
  7407.  
  7408.    MMSetLoc X%, Y%
  7409.  
  7410. X%         X coordinate ("column")
  7411. Y%         Y coordinate ("row")
  7412.  
  7413. Name  : MMSetRange           (Mouse Set Range)
  7414. Class : Mouse
  7415. Level : BIOS
  7416.  
  7417. This routine allows you to set the allowable range of mouse
  7418. cursor locations. The mouse cursor will not be permitted to go
  7419. outside this range.  It doesn't matter if the cursor is visible
  7420. or invisible.
  7421.  
  7422. The mouse cursor location is somewhat perverse in CGA and text
  7423. modes, due to the sloppy design of Microsoft's original mouse
  7424. driver.  In text modes and both CGA graphics modes, the cursor
  7425. is returned as if the screen is 640x200. To correct this for
  7426. SCREEN 1, double the X coordinate.  To correct this for text
  7427. modes, multiply each coordinate by eight and add four.
  7428.  
  7429. This routine will not work properly if there is no mouse
  7430. available.  Use the MMCheck routine if you are not sure.
  7431.  
  7432.    MMSetRange X1%, Y1%, X2%, Y2%
  7433.  
  7434. X1%       left   X coordinate (upper left "column")
  7435. Y1%       top    Y coordinate (upper left "row")
  7436. X2%       right  X coordinate (lower right "column")
  7437. Y2%       bottom Y coordinate (lower right "row")
  7438.  
  7439. Name  : Month0               (Month)
  7440. Class : String / Time
  7441. Level : Any
  7442.  
  7443. Given a month number, this routine tells you the name of the
  7444. month.
  7445.  
  7446.    MonthName$ = SPACE$(9)
  7447.    Month0 MonthName$, NameLen%, MonthNr%
  7448.    MonthName$ = LEFT$(MonthName$, NameLen)
  7449.  
  7450. MonthNr%    month number (1-12)
  7451. -------
  7452. MonthName$  name of the month.  Init to at least 9 characters.
  7453. NameLen%    length of the month name
  7454.  
  7455. Name  : MouseBuffer          (Mouse Buffer size)
  7456. Class : Mouse
  7457. Level : BIOS
  7458.  
  7459. This routine is used before MouseSave in order to find out how
  7460. many bytes are needed to save the mouse state.
  7461.  
  7462. This routine will not work properly if there is no mouse
  7463. available.  Use the MMCheck routine if you are not sure.
  7464.  
  7465.    MouseBuffer Bytes%
  7466.    St$ = SPACE$(Bytes%)
  7467.    MouseSave St$
  7468.  
  7469. -------
  7470. Bytes%     number of bytes needed to save the state of the mouse
  7471.  
  7472. Name  : MouseCursor          (Mouse Cursor type)
  7473. Class : Mouse
  7474. Level : BIOS
  7475.  
  7476. The MouseCursor routine allows you to select one of a number of
  7477. graphics mouse cursors.  The following types are supported:
  7478.  
  7479.     0   hourglass ("please wait" symbol)
  7480.     1   standard arrow pointer
  7481.     2   pointing hand
  7482.     3   crosshair
  7483.     4   target (box-in-a-box pointer)
  7484.     5   grabbing hand
  7485.  
  7486. If you'd like other shapes, please suggest a few!  I'll be glad
  7487. to add them.
  7488.  
  7489.    MouseCursor CursorNr%
  7490.  
  7491. CursorNr%    type of mouse graphics cursor to use (see above)
  7492.  
  7493. Name  : MousePen             (Mouse light Pen emulation)
  7494. Class : Mouse
  7495. Level : BIOS
  7496.  
  7497. The mouse can be made to emulate a light pen, allowing you to
  7498. use BASIC's light pen routines to provide a certain minimal
  7499. level of support for both light pens and mice.  This emulation
  7500. is on by default, but you can turn it off in case there is an
  7501. actual light pen attached.
  7502.  
  7503. This routine will not work properly if there is no mouse
  7504. available.  Use the MMCheck routine if you are not sure.
  7505.  
  7506.    MousePen EmulatePen%
  7507.  
  7508. EmulatePen%   whether mouse should emulate light pen (0 no)
  7509.  
  7510. Name  : MouseRest            (Mouse status Restore)
  7511. Class : Mouse
  7512. Level : BIOS
  7513.  
  7514. This routine is for use in conjunction with MouseSave.  It
  7515. allows you to restore the mouse settings to a state that was
  7516. saved in the past.
  7517.  
  7518. This routine will not work properly if there is no mouse
  7519. available.  Use the MMCheck routine if you are not sure.
  7520.  
  7521.    MouseRest St$
  7522.  
  7523. St$        mouse state to restore
  7524.  
  7525. Name  : MouseSave            (Mouse status Save)
  7526. Class : Mouse
  7527. Level : BIOS
  7528.  
  7529. This one is handy for use in subprograms or when SHELLing to
  7530. other programs that may use the mouse.  It allows you to save
  7531. the current mouse settings as a string.  To find out how long
  7532. the string should be, use MouseBuffer.
  7533.  
  7534. This routine will not work properly if there is no mouse
  7535. available.  Use the MMCheck routine if you are not sure.
  7536.  
  7537.    MouseBuffer Bytes%
  7538.    St$ = SPACE$(Bytes%)
  7539.    MouseSave St$
  7540.  
  7541. -------
  7542. St$        saved mouse state.  Init as shown above.
  7543.  
  7544. Name  : MPrint               (MS-DOS Print)
  7545. Class : Display
  7546. Level : BIOS
  7547.  
  7548. The MPrint routine displays text using mostly DOS services.
  7549. This allows it to handle ANSI codes if an ANSI driver is
  7550. installed.  In addition, the output of MPrint is confined to a
  7551. region of the screen that you may select with MWindow.  By
  7552. default, the region is 1,1 to 25,80: a full 80x25 text screen.
  7553.  
  7554. Using MPrint is similar to using PRINT followed by a semicolon.
  7555. It does not automatically move to the next line.  To do so, you
  7556. must MPrint a carriage return and linefeed: CHR$(13) + CHR$(10).
  7557.  
  7558. To clear the MWindow region, MPrint a formfeed: CHR$(12).
  7559.  
  7560.    MPrint St$
  7561.  
  7562. St$         string to display
  7563.  
  7564. Name  : MulMatI              (Multiply Matrix by Integer)
  7565. Class : Array management
  7566. Level : Any
  7567.  
  7568. This routine multiplies as many elements of an integer array as
  7569. you like by a given number, starting at a specified place in
  7570. the array.  If there was a numeric overflow at any point in the
  7571. operation, an error code will be returned.
  7572.  
  7573.    MulMatI DSeg%, DOfs%, Elements%, Value%, ErrCode%
  7574.  
  7575. DSeg%      segment of the array element to start at
  7576. DOfs%      offset of the array element to start at
  7577. Elements%  number of array elements to process
  7578. Value%     value to multiply each array element by
  7579. -------
  7580. ErrCode%   error code: 0 if no error
  7581.  
  7582. Name  : MultiAND             (Multiple AND)
  7583. Class : String
  7584. Level : Any
  7585.  
  7586. The MultiAND routine performs an arithmetic "AND" operation on
  7587. each character in a string.
  7588.  
  7589. Among the varied uses for MultiAND is stripping the high bit
  7590. from characters, as you might want to do in telecommunications
  7591. or in converting WordStar files.  In that case, you would use a
  7592. BitMask% of 127.
  7593.  
  7594.    MultiAND St$, BitMask%
  7595.  
  7596. St$        string to process
  7597. BitMask%   bit mask (0-255) with which to AND each character
  7598. -------
  7599. St$        processed string
  7600.  
  7601. Name  : MultiOR              (Multiple OR)
  7602. Class : String
  7603. Level : Any
  7604.  
  7605. The MultiOR routine performs an arithmetic "OR" operation on
  7606. each character in a string.
  7607.  
  7608.    MultiOR St$, BitMask%
  7609.  
  7610. St$        string to process
  7611. BitMask%   bit mask (0-255) with which to OR each character
  7612. -------
  7613. St$        processed string
  7614.  
  7615. Name  : MultiXOR             (Multiple XOR)
  7616. Class : String
  7617. Level : Any
  7618.  
  7619. The MultiXOR routine performs an arithmetic "XOR" operation on
  7620. each character in a string.
  7621.  
  7622.    MultiXOR St$, BitMask%
  7623.  
  7624. St$        string to process
  7625. BitMask%   bit mask (0-255) with which to XOR each character
  7626. -------
  7627. St$        processed string
  7628.  
  7629. Name  : MWindow              (MS-DOS Window)
  7630. Class : Display
  7631. Level : Any
  7632.  
  7633. The MWindow routine works in conjunction with MPrint.  It
  7634. defines an area of the screen in which text displayed by MPrint
  7635. must stay.  The default window is 1,1 to 25,80.
  7636.  
  7637.    MWindow TopRow%, LeftCol%, BottomRow%, RightCol%
  7638.  
  7639. TopRow%     top row
  7640. LeftCol%    left column
  7641. BottomRow%  bottom row
  7642. RightCol%   right column
  7643.  
  7644. Name  : NameCase             (Name Case)
  7645. Class : String
  7646. Level : Any
  7647.  
  7648. This routine provides a specialized uppercase/lowercase
  7649. converter designed especially for names.  It converts the first
  7650. letter in each word in a string to uppercase, with the rest of
  7651. the word being converted to lowercase.
  7652.  
  7653. See also NameCase2, the FUNCTION version of this routine.
  7654.  
  7655.    NameCase St$
  7656.  
  7657. St$         string to process
  7658. -------
  7659. St$         processed string
  7660.  
  7661. Name  : NameCase2$           (Name Case)
  7662. Class : String
  7663. Level : Any
  7664.  
  7665. This routine provides a specialized uppercase/lowercase
  7666. converter designed especially for names.  It converts the first
  7667. letter in each word in a string to uppercase, with the rest of
  7668. the word being converted to lowercase.
  7669.  
  7670. See also NameCase, the SUB version of this routine.
  7671.  
  7672.    Result$ = NameCase2$(St$)
  7673.  
  7674. St$         string to process
  7675. -------
  7676. Result$     processed string
  7677.  
  7678. Name  : Num2Phone$           (compressed phone# to string)
  7679. Class : Numeric String
  7680. Level : Any
  7681.  
  7682. This function takes a phone number (as encoded by Phone2Num&)
  7683. and converts it to unformatted string form.  Depending on the
  7684. original number, the result may be 4, 7, or 10 characters in
  7685. length.  An invalid code will result in a null string.
  7686.  
  7687.    Result$ = Num2Phone$(PhoneNumber&)
  7688.  
  7689. PhoneNumber&    encoded phone number
  7690. -------
  7691. Result$         phone number ("" if invalid number)
  7692.  
  7693. Name  : NumFormat            (Number Format)
  7694. Class : Numeric
  7695. Level : DOS
  7696.  
  7697. This works just like PRINT USING, but returns the results in a
  7698. string rather than sending them to the display or a file.
  7699.  
  7700. Note that an interaction between QuickBASIC, DOS and some
  7701. networks means that this routine will briefly access the
  7702. default drive.  Strange but true.
  7703.  
  7704.    NumFormat Format$, Number#, Result$
  7705.  
  7706. Format$     numeric format
  7707. Number#     number to format
  7708. -------
  7709. Result$     formatted number
  7710.  
  7711. Name  : NumProc              (Numeric Processor)
  7712. Class : Equipment
  7713. Level : Any
  7714.  
  7715. NumProc returns the type of numeric coprocessor installed.  I
  7716. haven't tried it with a 80486, but I would guess an 80486
  7717. always appears to have an 80387 (unless it's one of those
  7718. brain-damaged 80486SX chips).
  7719.  
  7720. Results are returned as follows:
  7721.  
  7722.    0    no math chip
  7723.    1    8087
  7724.    2    80287
  7725.    3    80387
  7726.  
  7727. If anyone can tell me how to better handle a 486 here, I'd
  7728. appreciate it.
  7729.  
  7730.    NumProc ProcType%
  7731.  
  7732. -------
  7733. ProcType%    type of numeric coprocessor (see above)
  7734.  
  7735. Name  : NumProc2%            (Numeric Processor)
  7736. Class : Equipment
  7737. Level : Any
  7738.  
  7739. NumProc2% returns the type of numeric coprocessor installed.  I
  7740. haven't tried it with a 80486, but I would guess an 80486
  7741. always appears to have an 80387 (unless it's one of those
  7742. brain-damaged 80486SX chips).
  7743.  
  7744.  
  7745. Results are returned as follows:
  7746.  
  7747.    0    no math chip
  7748.    1    8087
  7749.    2    80287
  7750.    3    80387
  7751.  
  7752. If anyone can tell me how to better handle a 486 here, I'd
  7753. appreciate it.
  7754.  
  7755.    ProcType% = NumProc2%
  7756.  
  7757. -------
  7758. ProcType%    type of numeric coprocessor (see above)
  7759.  
  7760. Name  : ObjScan              (Object file Scan)
  7761. Class : Disk
  7762. Level : DOS
  7763.  
  7764. This routine returns information about a specified .OBJ file.
  7765. It returns the module name, public names, and external names.
  7766. The module name is generally the name of the original file
  7767. which was compiled to produce the .OBJ file. Public names are
  7768. the names of routines (and sometimes variables) that can be
  7769. accessed by outside programs.  External names are the names of
  7770. routines (and variables) that the .OBJ file expects to be
  7771. provided by outside programs.
  7772.  
  7773. External names containing "$", starting with "_" or with
  7774. lowercase characters are screened out to avoid returning a huge
  7775. list of BASIC internal routines. For the same reason, routines
  7776. ending with "QQ" will also be screened out, as will
  7777. STRINGADDRESS, STRINGASSIGN, STRINGLENGTH, and STRINGRELEASE.
  7778. Y'know, it would be nice if Microsoft followed some sort of
  7779. standard for its names.
  7780.  
  7781. The public and external names are returned in string arrays.
  7782. ObjScan will fail with an error code if there is insufficient
  7783. space, so be sure to allow plenty of room.  If scanning
  7784. subprograms, a DIM to 30 or 40 elements is probably ample.  If
  7785. scanning large programs, you may need to increase the
  7786. dimensions substantially.
  7787.  
  7788. The ObjScan routine can be used as the basis for a simple ".OBJ
  7789. info" utility or for more complex applications, such as library
  7790. management.
  7791.  
  7792.    ObjScan ObjFile$, ModName$, Routine$(), External$(), ErrCode%
  7793.  
  7794. ObjFile$      name of .OBJ file
  7795. -------
  7796. ModName$      module name
  7797. Routine$()    public names
  7798. External$()   external names
  7799. ErrCode%      whether there was an error (0 no)
  7800.  
  7801. Name  : Odd%                 (Odd integer?)
  7802. Class : Numeric
  7803. Level : Any
  7804.  
  7805. This function returns whether an integer is odd.  If so, it
  7806. returns -1, otherwise 0.
  7807.  
  7808.    Result% = Odd%(Number%)
  7809.  
  7810. Number%    number to test
  7811. -------
  7812. Result%    whether the number is odd
  7813.  
  7814. Name  : OddL%                 (Odd Long integer?)
  7815. Class : Numeric
  7816. Level : Any
  7817.  
  7818. This function returns whether a long integer is odd.  If so, it
  7819. returns -1, otherwise 0.
  7820.  
  7821.    Result% = Odd%(Number&)
  7822.  
  7823. Number&    number to test
  7824. -------
  7825. Result%    whether the number is odd
  7826.  
  7827. Name  : OrSt                 (OR String)
  7828. Class : String
  7829. Level : Any
  7830.  
  7831. This routine ORs each byte in one string with the corresponding
  7832. byte in a second string.  The strings must be the same length.
  7833.  
  7834.    OrSt St1$, St2$
  7835.  
  7836. St1$      string to OR
  7837. St2$      string to OR with
  7838. -------
  7839. St1$      result
  7840.  
  7841. Name  : ParseFSpec           (Parse File Specification)
  7842. Class : Disk
  7843. Level : Any
  7844.  
  7845. This routine splits a file specification into a drive,
  7846. subdirectory, and filename.  You are expected to initialize the
  7847. return strings to reasonable values beforehand (1 for drive, 64
  7848. for subdirectory, 12 for filename).  If the filespec may be
  7849. invalid, you may wish to leave additional space to avoid
  7850. potentially disastrous overflows.  An alternative would be to
  7851. use ExtendFSpec beforehand to check and complete the file
  7852. specification.  This is likely to be a good approach anyway--
  7853. these two routines complement each other nicely.
  7854.  
  7855.    Drive$ = SPACE$(1)
  7856.    Subdir$ = SPACE$(64)
  7857.    File$ = SPACE$(12)
  7858.    ParseFSpec FileSpec$, Drive$, DLen%, Subdir$, SLen%,
  7859.       File$, FLen%
  7860.    Drive$ = LEFT$(Drive$, DLen%)
  7861.    Subdir$ = LEFT$(Subdir$, SLen%)
  7862.    File$ = LEFT$(File$, FLen%)
  7863.  
  7864. FileSpec$   file specification
  7865. -------
  7866. Drive$      drive letter (init to 1+)
  7867. DLen%       length of Drive$
  7868. SubDir$     subdirectory (init to 64+)
  7869. SLen%       length of Subdir$
  7870. File$       file name (init to 12+)
  7871. FLen%       length of File$
  7872.  
  7873. Name  : PatchDone            (Patch Done)
  7874. Class : Disk
  7875. Level : DOS
  7876.  
  7877. This routine closes the file opened by FindPatch.  You must use
  7878. PatchDone when you are finished patching the file.
  7879.  
  7880. Routines in this set include FindPatch, SetPatch, and PatchDone.
  7881.  
  7882.    PatchDone
  7883.  
  7884. Name  : PCDat$               (PC Date)
  7885. Class : Equipment
  7886. Level : Clone
  7887.  
  7888. The PCDat$ routine tells you the date of the BIOS ROM chip.
  7889. This date is not always available on some (mostly older)
  7890. clones, in which case "No Date" is returned.
  7891.  
  7892.    ROMDate$ = PCDat$
  7893.  
  7894. -------
  7895. ROMDate$   date of the BIOS ROM (xx/xx/xx).
  7896.  
  7897. Name  : PCDate               (PC Date)
  7898. Class : Equipment
  7899. Level : Clone
  7900.  
  7901. The PCDate routine tells you the date of the BIOS ROM chip.
  7902. This date is not always available on some (mostly older)
  7903. clones, in which case "No Date " is returned.  See also PCDat,
  7904. a function version of this routine.
  7905.  
  7906.    ROMDate$ = SPACE$(8)
  7907.    PCDate ROMDate$
  7908.  
  7909. -------
  7910. ROMDate$   date of the BIOS ROM (xx/xx/xx).  Init to 8+ chars.
  7911.  
  7912. Name  : PCType               (PC Type)
  7913. Class : Equipment
  7914. Level : Clone
  7915.  
  7916. This routine returns the machine I.D. code.  This code may not
  7917. be one of the listed values for some (mostly older) clones, but
  7918. the following is usually correct:
  7919.  
  7920.    I.D.  ....Machine....
  7921.    255   PC or XT
  7922.    254   XT
  7923.    253   PCjr
  7924.    252   PC AT
  7925.    251   XT
  7926.    250   PS/2 Model 30
  7927.    249   PC Convertible
  7928.    248   PS/2 Model 70 or 80
  7929.    154   Compaq Portable
  7930.     45   Compaq Portable
  7931.  
  7932. Note that, for identification purposes, a PC and XT are
  7933. essentially the same. The XT is simply a PC with an auto-boot
  7934. hard drive.  New I.D. numbers come out more or less at random
  7935. from IBM, although they aren't as capricious about it as they
  7936. used to be.  It is useful to identify Compaq Portables as
  7937. separate from PCs because those machines had an unusual
  7938. display, which acts like a CGA but has the resolution (in text
  7939. modes) of an MDA.  Hence, the cursor size of a Compaq Portable
  7940. is MDA-sized in text mode, but CGA-sized in graphics modes,
  7941. even though ordinary tests will tell your program that a CGA is
  7942. attached.  If you intend to alter the cursor size, this is an
  7943. important distinction, since the Compaq Portable was a great
  7944. success and is still in wide use.  Current Compaq machines,
  7945. like most other clones, follow the standard IBM I.D. codes.
  7946.  
  7947. See also PCType2, a function version of this routine.
  7948.  
  7949.    PCType MachineID%
  7950.  
  7951. -------
  7952. MachineID%   type of computer
  7953.  
  7954. Name  : PCType2%             (PC Type)
  7955. Class : Equipment
  7956. Level : Clone
  7957.  
  7958. This routine returns the machine I.D. code.  This code may not
  7959. be one of the listed values for some (mostly older) clones, but
  7960. the following is usually correct:
  7961.    I.D.  ....Machine....
  7962.    255   PC or XT
  7963.    254   XT
  7964.    253   PCjr
  7965.    252   PC AT
  7966.    251   XT
  7967.    250   PS/2 Model 30
  7968.    249   PC Convertible
  7969.    248   PS/2 Model 70 or 80
  7970.    154   Compaq Portable
  7971.     45   Compaq Portable
  7972.  
  7973. Note that, for identification purposes, a PC and XT are
  7974. essentially the same. The XT is simply a PC with an auto-boot
  7975. hard drive.  New I.D. numbers come out more or less at random
  7976. from IBM, although they aren't as capricious about it as they
  7977. used to be.  It is useful to identify Compaq Portables as
  7978. separate from PCs because those machines had an unusual
  7979. display, which acts like a CGA but has the resolution (in text
  7980. modes) of an MDA.  Hence, the cursor size of a Compaq Portable
  7981. is MDA-sized in text mode, but CGA-sized in graphics modes,
  7982. even though ordinary tests will tell your program that a CGA is
  7983. attached.  If you intend to alter the cursor size, this is an
  7984. important distinction, since the Compaq Portable was a great
  7985. success and is still in wide use.  Current Compaq machines,
  7986. like most other clones, follow the standard IBM I.D. codes.
  7987.  
  7988.    MachineID% = PCType2%
  7989.  
  7990. -------
  7991. MachineID%   type of computer
  7992.  
  7993. Name  : Phone2Num&           (Phone# to Number)
  7994. Class : Numeric String
  7995. Level : Any
  7996.  
  7997. This function converts a U.S. or Canadian phone number from
  7998. string form to a long integer.  It accepts phone numbers of 4,
  7999. 7, 10, or 11 digits.  If there are 11 digits, the first digit
  8000. must be a 1.  Non-numeric characters are ignored so that
  8001. formatted phone numbers can be used.  If the phone number is of
  8002. the wrong length or otherwise does not appear to be valid, -1
  8003. is returned; otherwise, the result is a long integer which
  8004. represents the phone number in a format that can be decoded by
  8005. Num2Phone$.
  8006.  
  8007. This function will accept alphabetic phone numbers and convert
  8008. them to their numeric equivalents.
  8009.  
  8010. Since it only takes 4 bytes to store a long integer, as opposed
  8011. to 7 to 10 or more for the usual alphanumeric form, this can be
  8012. considered a compression routine as well as a validation
  8013. routine.  At worst, for 4-digit phone numbers, it is exactly as
  8014. efficient as a character representation.  For 7 or 10-digit
  8015. phone numbers, it roughly doubles your storage space.
  8016.  
  8017. A few words on how checking is done: obviously, there is no way
  8018. to tell whether a number is in use or is in fact whoever you
  8019. wished to call.  However, there are certain regularities to
  8020. numeric phone numbers which can be used to detect blatantly
  8021. false numbers.  Alphabetic phone numbers do not include all the
  8022. letters of the alphabet, either.  This routine will check for
  8023. any obvious peculiarities and warn you accordingly.
  8024.  
  8025.    Result& = Phone2Num&(PhoneNumber$)
  8026.  
  8027. PhoneNumber$    phone number (may be formatted)
  8028. -------
  8029. Result&         encoded phone number (-1 if invalid number)
  8030.  
  8031. Name  : PrinterInit          (Printer Initialize)
  8032. Class : Printer
  8033. Level : BIOS
  8034.  
  8035. This routine initializes a printer in the same way as if the
  8036. computer had been rebooted.
  8037.  
  8038. Note that this will not work on serial printers, even if the
  8039. MODE command was used to redirect the port.  It works at the
  8040. BIOS level, so it doesn't know about any fooling around DOS
  8041. does.
  8042.  
  8043.    PrinterInit Port%
  8044.  
  8045. Port%         parallel port number (1-3)
  8046.  
  8047. Name  : PrinterReady%        (Printer Ready)
  8048. Class : Printer
  8049. Level : BIOS
  8050.  
  8051. This function lets you know if a printer is ready.  It checks
  8052. to make sure that the specified port exists, then makes sure a
  8053. printer is connected, turned on, and has paper in it.
  8054.  
  8055. Note that this will not work on serial printers, even if the
  8056. MODE command was used to redirect the port.  It works at the
  8057. BIOS level, so it doesn't know about any fooling around DOS
  8058. does.
  8059.  
  8060.    Ready% = PrinterReady%(Port%)
  8061.  
  8062. Port%         parallel port number (1-3)
  8063. -------
  8064. Ready%        whether there's a printer ready at that port
  8065.  
  8066. Name  : PrintFile            (Print File)
  8067. Class : Printer
  8068. Level : DOS
  8069.  
  8070. This routine sends a file to the printer.  It does not
  8071. paginate, spool, or anything else fancy.  The LPT1 or PRN
  8072. device is used by default, although you can change this using
  8073. the PrtSwap routine.
  8074.  
  8075. The predefined device handle for stdprn is used, so don't use
  8076. FClose1 to free that handle if you expect to use this routine.
  8077. The results could be nasty.
  8078.  
  8079.    PrintFile FileName$, ErrCode%
  8080.  
  8081. FileName$     name of the file to print
  8082. -------
  8083. ErrCode%      whether there was an error (0 no, else DOS Error)
  8084.  
  8085. Name  : PrintScreen          (Print Screen)
  8086. Class : Display / Printer
  8087. Level : BIOS
  8088.  
  8089. Just like pressing the PrtSc/PrintScrn key on the keyboard,
  8090. this routine sends the contents of the display to the printer.
  8091. It is mostly designed for text modes, but use of the GRAPHICS
  8092. TSR provided with DOS will allow it to print out CGA graphics
  8093. displays as well.  For some reason, the GRAPHICS utility does
  8094. not handle Hercules, EGA or VGA displays; however, alternative
  8095. utilities which provide such features may be obtained from your
  8096. local BBS.
  8097.  
  8098.    PrintScreen
  8099.  
  8100. Name  : Processor            (Processor)
  8101. Class : Equipment
  8102. Level : Any
  8103.  
  8104. Processor returns the type of processor (CPU) installed.
  8105.  
  8106. Results are returned as follows:
  8107.  
  8108.    0    NEC V20
  8109.    1    8088 or 8086
  8110.    2    80186
  8111.    3    80286
  8112.    4    80386
  8113.    5    80486
  8114.  
  8115. Note that, for most practical purposes, a NEC V20 works just
  8116. like an 80186.
  8117.  
  8118.    Processor ProcType%
  8119.  
  8120. -------
  8121. ProcType%    type of CPU (see above)
  8122.  
  8123. Name  : Processor2%          (Processor)
  8124. Class : Equipment
  8125. Level : Any
  8126.  
  8127. Processor returns the type of processor (CPU) installed.
  8128.  
  8129. Results are returned as follows:
  8130.  
  8131.    0    NEC V20
  8132.    1    8088 or 8086
  8133.    2    80186
  8134.    3    80286
  8135.    4    80386
  8136.    5    80486
  8137.  
  8138. Note that, for most practical purposes, a NEC V20 works just
  8139. like an 80186.
  8140.  
  8141.    ProcType% = Processor2%
  8142.  
  8143. -------
  8144. ProcType%    type of CPU (see above)
  8145.  
  8146. Name  : PrtSc                (Print Screen key)
  8147. Class : Input / Printer
  8148. Level : BIOS
  8149.  
  8150. This routine allows you to disable the "print screen" key.
  8151. This only affects the keyboard, not the PrintScreen routine in
  8152. PBClone.
  8153.  
  8154. If you disable the "print screen" key, be sure to enable it
  8155. again before your program ends.  Otherwise, the "print screen"
  8156. key will be left in an undefined state, probably causing the
  8157. computer to crash when it is next pressed.
  8158.  
  8159.    PrtSc Enable%
  8160.  
  8161. Enable%   whether "print screen" should be enabled (0 no)
  8162.  
  8163. Name  : PrtSwap              (Printer Swap)
  8164. Class : Printer
  8165. Level : Clone
  8166.  
  8167. It's handy to use LPRINT, but it isn't always practical.
  8168. LPRINT only works on the first printer available (PRN or
  8169. LPT1).  With this routine, it doesn't matter.  PrtSwap allows
  8170. you to swap any two printer ports.
  8171.  
  8172. Note that it's a good idea to swap the ports back to their
  8173. original locations before exiting your program.  You could
  8174. cause major confusion otherwise!
  8175.  
  8176.    PrtSwap Port1%, Port2%
  8177.  
  8178. Port1%    number of the first port (1-3)
  8179. Port2%    number of the second port (1-3)
  8180.  
  8181. Name  : PSortD               (Pointer Sort Double precision)
  8182. Class : Array management
  8183. Level : Any
  8184.  
  8185. This routine sorts the elements in a double precision array...
  8186. well, actually, it doesn't change the position of anything in
  8187. the double precision array.  It sorts the array using a set of
  8188. pointers to the array.  You can then use the pointers to refer
  8189. to the array or to re-order the array yourself.
  8190.  
  8191. Why bother with pointers?  Well, it's a lot faster than sorting
  8192. the numbers directly, since less information has to be
  8193. swapped.  It has another major advantage, though-- it allows
  8194. you to sort an array without losing track of how it corresponds
  8195. to any related arrays.
  8196.  
  8197. The array is assumed to start at element 1.  You may specify
  8198. the last element in the array, allowing you to sort only part
  8199. of an array if you like.
  8200.  
  8201. The pointer array must be initialized so that each element is
  8202. equal to its index.  Either use InitPtr or do:
  8203.    FOR tmp% = 1 TO Elements%
  8204.       Ptr%(tmp%) = tmp%
  8205.    NEXT
  8206.  
  8207. After this routine, you can access the sorted array via the
  8208. pointer array. For instance, to print out a sorted double
  8209. precision array, you'd use:
  8210.    FOR tmp% = 1 TO Elements%
  8211.       PRINT Array#(Ptr%(tmp%))
  8212.    NEXT
  8213.  
  8214. If you would like the results to be last-to-first, rather than
  8215. first-to-last, just call ReverseI to reverse the pointer array
  8216. (after this routine).
  8217.  
  8218.    PSortD Ptr%(), Array#(), Elements%
  8219.  
  8220. Ptr%()      pointers to array to be sorted
  8221. Array#()    array to be sorted
  8222. Elements%   number of elements in array
  8223. -------
  8224. Ptr%()      pointers which allow accessing array in sorted order
  8225.  
  8226. Name  : PSortI               (Pointer Sort Integer)
  8227. Class : Array management
  8228. Level : Any
  8229.  
  8230. This routine sorts the elements in an integer array... well,
  8231. actually, it doesn't change the position of anything in the
  8232. integer array.  It sorts the array using a set of pointers to
  8233. the array.  You can then use the pointers to refer to the array
  8234. or to re-order the array yourself.
  8235.  
  8236. Why bother with pointers?  It has a major advantage-- it allows
  8237. you to sort an array without losing track of how it corresponds
  8238. to any related arrays.
  8239.  
  8240. The array is assumed to start at element 1.  You may specify
  8241. the last element in the array, allowing you to sort only part
  8242. of an array if you like.
  8243.  
  8244. The pointer array must be initialized so that each element is
  8245. equal to its index.  Either use InitPtr or do:
  8246.    FOR tmp% = 1 TO Elements%
  8247.       Ptr%(tmp%) = tmp%
  8248.    NEXT
  8249.  
  8250. After this routine, you can access the sorted array via the
  8251. pointer array. For instance, to print out a sorted integer
  8252. array, you'd use:
  8253.    FOR tmp% = 1 TO Elements%
  8254.       PRINT Array%(Ptr%(tmp%))
  8255.    NEXT
  8256.  
  8257. If you would like the results to be last-to-first, rather than
  8258. first-to-last, just call ReverseI to reverse the pointer array
  8259. (after this routine).
  8260.  
  8261.    PSortI Ptr%(), Array%(), Elements%
  8262.  
  8263. Ptr%()      pointers to array to be sorted
  8264. Array%()    array to be sorted
  8265. Elements%   number of elements in array
  8266. -------
  8267. Ptr%()      pointers which allow accessing array in sorted order
  8268.  
  8269. Name  : PSortL               (Pointer Sort Long integer)
  8270. Class : Array management
  8271. Level : Any
  8272.  
  8273. This routine sorts the elements in a long integer array...
  8274. well, actually, it doesn't change the position of anything in
  8275. the long integer array.  It sorts the array using a set of
  8276. pointers to the array.  You can then use the pointers to refer
  8277. to the array or to re-order the array yourself.
  8278.  
  8279. Why bother with pointers?  Well, it's a lot faster than sorting
  8280. the numbers directly, since less information has to be
  8281. swapped.  It has another major advantage, though-- it allows
  8282. you to sort an array without losing track of how it corresponds
  8283. to any related arrays.
  8284.  
  8285. The array is assumed to start at element 1.  You may specify
  8286. the last element in the array, allowing you to sort only part
  8287. of an array if you like.
  8288.  
  8289. The pointer array must be initialized so that each element is
  8290. equal to its index.  Either use InitPtr or do:
  8291.    FOR tmp% = 1 TO Elements%
  8292.       Ptr%(tmp%) = tmp%
  8293.    NEXT
  8294.  
  8295. After this routine, you can access the sorted array via the
  8296. pointer array. For instance, to print out a sorted long integer
  8297. array, you'd use:
  8298.    FOR tmp% = 1 TO Elements%
  8299.       PRINT Array&(Ptr%(tmp%))
  8300.    NEXT
  8301.  
  8302. If you would like the results to be last-to-first, rather than
  8303. first-to-last, just call ReverseI to reverse the pointer array
  8304. (after this routine).
  8305.  
  8306.    PSortL Ptr%(), Array&(), Elements%
  8307.  
  8308. Ptr%()      pointers to array to be sorted
  8309. Array&()    array to be sorted
  8310. Elements%   number of elements in array
  8311. -------
  8312. Ptr%()      pointers which allow accessing array in sorted order
  8313.  
  8314. Name  : PSortS               (Pointer Sort Single precision)
  8315. Class : Array management
  8316. Level : Any
  8317.  
  8318. This routine sorts the elements in a single precision array...
  8319. well, actually, it doesn't change the position of anything in
  8320. the single precision array.  It sorts the array using a set of
  8321. pointers to the array.  You can then use the pointers to refer
  8322. to the array or to re-order the array yourself.
  8323.  
  8324. Why bother with pointers?  Well, it's a lot faster than sorting
  8325. the numbers directly, since less information has to be
  8326. swapped.  It has another major advantage, though-- it allows
  8327. you to sort an array without losing track of how it corresponds
  8328. to any related arrays.
  8329.  
  8330. The array is assumed to start at element 1.  You may specify
  8331. the last element in the array, allowing you to sort only part
  8332. of an array if you like.
  8333.  
  8334. The pointer array must be initialized so that each element is
  8335. equal to its index.  Either use InitPtr or do:
  8336.    FOR tmp% = 1 TO Elements%
  8337.       Ptr%(tmp%) = tmp%
  8338.    NEXT
  8339.  
  8340. After this routine, you can access the sorted array via the
  8341. pointer array. For instance, to print out a sorted single
  8342. precision array, you'd use:
  8343.    FOR tmp% = 1 TO Elements%
  8344.       PRINT Array!(Ptr%(tmp%))
  8345.    NEXT
  8346.  
  8347. If you would like the results to be last-to-first, rather than
  8348. first-to-last, just call ReverseI to reverse the pointer array
  8349. (after this routine).
  8350.  
  8351.    PSortS Ptr%(), Array!(), Elements%
  8352.  
  8353. Ptr%()      pointers to array to be sorted
  8354. Array!()    array to be sorted
  8355. Elements%   number of elements in array
  8356. -------
  8357. Ptr%()      pointers which allow accessing array in sorted order
  8358.  
  8359. Name  : PSortSt              (Pointer Sort String)
  8360. Class : Array management
  8361. Level : Any
  8362.  
  8363. This routine sorts the elements in a string array... well,
  8364. actually, it doesn't change the position of anything in the
  8365. string array.  It sorts the array using a set of pointers to
  8366. the array.  You can then use the pointers to refer to the array
  8367. or to re-order the array yourself.
  8368.  
  8369. Why bother with pointers?  Well, it's a lot faster than sorting
  8370. the strings directly, since less information has to be
  8371. swapped.  It has another major advantage, though-- it allows
  8372. you to sort an array without losing track of how it corresponds
  8373. to any related arrays.  For instance, if you have one array
  8374. holding names and another holding phone numbers, this allows
  8375. you to sort on names without losing track of which phone
  8376. numbers are which.
  8377.  
  8378. The array is assumed to start at element 1.  You may specify
  8379. the last element in the array, allowing you to sort only part
  8380. of an array if you like.  You can also specify whether the
  8381. capitalization of letters in a string should matter for sorting
  8382. purposes.
  8383.  
  8384. The pointer array must be initialized so that each element is
  8385. equal to its index.  Either use InitPtr or do:
  8386.    FOR tmp% = 1 TO Elements%
  8387.       Ptr%(tmp%) = tmp%
  8388.    NEXT
  8389.  
  8390. After this routine, you can access the sorted array via the
  8391. pointer array. For instance, to print out a sorted string
  8392. array, you'd use:
  8393.    FOR tmp% = 1 TO Elements%
  8394.       PRINT Array$(Ptr%(tmp%))
  8395.    NEXT
  8396.  
  8397. If you would like the results to be last-to-first, rather than
  8398. first-to-last, just call ReverseI to reverse the pointer array
  8399. (after this routine).
  8400.  
  8401.    PSortSt Ptr%(), Array$(), Elements%, CapsCount%
  8402.  
  8403. Ptr%()      pointers to array to be sorted
  8404. Array$()    array to be sorted
  8405. CapsCount%  use 0 if uppercase/lowercase distinctions don't matter
  8406. Elements%   number of elements in array
  8407. -------
  8408. Ptr%()      pointers which allow accessing array in sorted order
  8409.  
  8410. Name  : PutScreen            (Put Screen)
  8411. Class : Display
  8412. Level : Clone
  8413.  
  8414. This routine restores a portion of the display (which was saved
  8415. to an array by DGetScreen or GetScreen) to the screen.  Only
  8416. text modes are supported. If your program uses multiple display
  8417. pages, you can put the image onto any of those pages.  A
  8418. special "slow" mode is supported for the CGA, to prevent
  8419. flickering (a problem only with some CGAs).
  8420.  
  8421. If you wish to restore the entire screen, you may find ScrRest
  8422. easier (see).
  8423.  
  8424.    PutScreen Array%(), TRow%, LCol%, BRow%, RCol%, Page%, Fast%
  8425.  
  8426. Array%()   array from which to restore the image
  8427. TRow%      top row of the desired screen area
  8428. LCol%      left column of the desired screen area
  8429. BRow%      bottom row of the desired screen area
  8430. RCol%      right column of the desired screen area
  8431. Page%      page on which to restore the display
  8432. Fast%      whether to use fast mode (0 no)
  8433.  
  8434. Name  : QPrint               (Quick Print)
  8435. Class : Display
  8436. Level : Clone
  8437.  
  8438. This is a replacement for the PRINT statement.  It is less
  8439. flexible in that it does not move the cursor or interpret
  8440. control codes, and because it uses the color that is already on
  8441. the screen instead of a specified color value. It also works
  8442. only in text modes.
  8443.  
  8444. In exchange, QPrint gives you much faster display speeds.
  8445.  
  8446. See also XQPrint, which is a bit more flexible (and somewhat
  8447. slower).
  8448.  
  8449.    QPrint St$, Row%, Column%, Page%, Fast%
  8450.  
  8451. St$        text to display
  8452. Row%       starting row
  8453. Column%    starting column
  8454. Page%      page on which to display
  8455. Fast%      whether to use fast mode (0 no)
  8456.  
  8457. Name  : Rand%                (Random number)
  8458. Class : Numeric
  8459. Level : Clone
  8460.  
  8461. This is a pseudo-random number function.  It returns a "random"
  8462. number in a range you specify (e.g., if you pass it 10, it will
  8463. return 0-9).  The number is less random than you'd get from the
  8464. BASIC function RND, and you can't set a random number seed a la
  8465. RANDOMIZE.  There is one major advantage to Rand%, however: it
  8466. doesn't bring in BASIC's floating point support, which makes it
  8467. much faster than RND and may make your program much smaller.
  8468.  
  8469.    Number% = Rand%(Range%)
  8470.  
  8471. Range%      range of desired pseudo-random number
  8472. -------
  8473. Number%     pseudo-random number from 0 to Range% - 1
  8474.  
  8475. Name  : ReadBitF             (Read Bit Field)
  8476. Class : Numeric
  8477. Level : Any
  8478.  
  8479. This routine allows you to get an element of a virtual array.
  8480. The actual array can be any numeric type, as it is just being
  8481. used as a storage area. The virtual array is composed of
  8482. numbers of a bit length that you specify (1-8).  This provides
  8483. efficient storage for numbers which have a limited range.
  8484.  
  8485. See also WriteBitF.
  8486.  
  8487.    ReadBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  8488.  
  8489. DSeg%        segment of actual array
  8490. DOfs%        offset of actual array
  8491. ElementNr&   virtual element number (starts at 0)
  8492. BitLen%      bits per virtual element (1-8)
  8493. -------
  8494. Value%       result (0-255 or less, depending on BitLen%)
  8495.  
  8496. Name  : Reboot               (Reboot)
  8497. Class : Miscellaneous
  8498. Level : Clone
  8499.  
  8500. This routine restarts the computer, just like typing
  8501. Control-Alt-Del at the keyboard.
  8502.  
  8503.    Reboot
  8504.  
  8505. Name  : Recolor              (Recolor)
  8506. Class : Display
  8507. Level : Clone
  8508.  
  8509. The Recolor routine changes all text in one color to another
  8510. color.  It works only in text modes.  The colors are specified
  8511. as attributes (see CalcAttr).
  8512.  
  8513.    Recolor OldAttr%, NewAttr%
  8514.  
  8515. OldAttr%   color to be changed
  8516. NewAttr%   color to which to change
  8517.  
  8518. Name  : RecolorArea          (Recolor Area)
  8519. Class : Display
  8520. Level : Clone
  8521.  
  8522. The RecolorArea routine changes a specified area of the screen
  8523. to a specified color.  It works only in text modes.  The color
  8524. is specified as an attribute (see CalcAttr).
  8525.  
  8526. See also HiLite, which provides an easier way of highlighting
  8527. between two columns on a single row.
  8528.  
  8529.    RecolorArea TRow%, LCol%, BRow%, RCol%, VAttr%, Page%, Fast%
  8530.  
  8531. TRow%       top row of area to recolor
  8532. LCol%       left column of area to recolor
  8533. BRow%       bottom row of area to recolor
  8534. RCol%       right column of area to recolor
  8535. VAttr%      desired color
  8536. Page%       display page (normally zero)
  8537. Fast%       whether to use fast mode (0 no)
  8538.  
  8539. Name  : RedirectIn%          (Redirect Input)
  8540. Class : Miscellaneous
  8541. Level : DOS
  8542.  
  8543. The RedirectIn% function allows you to determine whether input
  8544. has been redirected.  This lets you know whether input is
  8545. coming from the keyboard or from a file or device.
  8546.  
  8547. Input that is done by BIOS key routines (e.g., BIOSInkey) is
  8548. not affected by redirection, so if you want to support
  8549. redirection it is best to avoid such routines unless there is
  8550. something that must come from the keyboard.
  8551.  
  8552.    Redir% = RedirectIn%
  8553.  
  8554. -------
  8555. Redir%     whether input has been redirected (0 no)
  8556.  
  8557. Name  : RedirectOut%         (Redirect Output)
  8558. Class : Miscellaneous
  8559. Level : DOS
  8560.  
  8561. The RedirectOut% function allows you to determine whether
  8562. output has been redirected.  This lets you know whether output
  8563. is going to the display or to a file or device.
  8564.  
  8565. Output that is done by direct screen writes (e.g., XQPrint) is
  8566. not affected by redirection, so if you want to allow
  8567. redirection it is best to avoid such routines unless there is
  8568. something that must to go to the screen itself.
  8569.  
  8570.    Redir% = RedirectOut%
  8571.  
  8572. -------
  8573. Redir%     whether output has been redirected (0 no)
  8574.  
  8575. Name  : Rename               (Rename file)
  8576. Class : Disk
  8577. Level : DOS
  8578.  
  8579. This routine allows you to rename an ordinary file.  See also
  8580. RenSub.
  8581.  
  8582.    Rename CurrentName$, NewName$, ErrCode%
  8583.  
  8584. CurrentName$   current name of the file
  8585. NewName$       desired name of the file
  8586. -------
  8587. ErrCode%       error code: 0 if no error, else DOS Error
  8588.  
  8589. Name  : RenSub               (Rename Subdirectory)
  8590. Class : Disk
  8591. Level : DOS
  8592.  
  8593. This routine provides a service that was inexplicably left out
  8594. of the DOS command shell.  It allows you to rename a
  8595. subdirectory.
  8596.  
  8597. Note that renaming a subdirectory is only possible using
  8598. old-style FCB file handling.  This means that the subdirectory
  8599. which you specify must be in the current directory (the routine
  8600. doesn't really understand subdirectories per se, but treats
  8601. them like any other file).  In this implementation, no drive
  8602. specification is allowed either.  Finally, if there is an
  8603. error, the error code may be a simple "255" instead of a useful
  8604. disk error number.
  8605.  
  8606.    RenSub CurrentSub$, NewSub$, ErrCode%
  8607.  
  8608. CurrentSub$   current name of the subdirectory
  8609. NewSub$       desired name of the subdirectory
  8610. -------
  8611. ErrCode%      error code: 0 if no error, else DOS Error
  8612.  
  8613. Name  : Replace              (Replace character)
  8614. Class : String
  8615. Level : Any
  8616.  
  8617. This routine replaces all occurrences of a given character in a
  8618. string with another character.
  8619.  
  8620.    Replace St$, CurCh$, NewCh$
  8621.  
  8622. St$         string to process
  8623. CurCh$      character to be replaced
  8624. NewCh$      character to replace with
  8625. -------
  8626. St$         processed string
  8627.  
  8628. Name  : ReplaceString        (Replace String)
  8629. Class : String
  8630. Level : Any
  8631.  
  8632. This routine replaces all occurrences of a given substring
  8633. within a string with another substring.  The substrings may be
  8634. of any length.
  8635.  
  8636. An error code will be returned if the string to search for is
  8637. null.
  8638.  
  8639.    ReplaceString St$, Old$, New$, Found%, ErrCode%
  8640.  
  8641. St$         string to process
  8642. Old$        substring to be replaced
  8643. New$        substring to replace with
  8644. -------
  8645. Found%      whether a replacement was done (0 if no)
  8646. ErrCode%    whether there was an error (0 if no)
  8647.  
  8648. Name  : Retries              (Retries)
  8649. Class : Disk
  8650. Level : DOS 3.1+
  8651.  
  8652. This routine allows you to adjust the handling of file-sharing
  8653. errors.  When such an error occurs, DOS normally retries 3
  8654. times, with a wait of 1 between tries.  This allows temporary
  8655. conditions, such as someone else using the file you want to
  8656. access, to clear up.  In many cases, though, you may want to
  8657. change this delay.  A shorter delay will improve response time,
  8658. allowing your program to handle the error more quickly.  A
  8659. longer delay may be more suited for a busy network, allowing
  8660. the request to proceed after a reasonable waiting period.
  8661.  
  8662. The delay period between each retry is unfortunately
  8663. machine-dependent, i.e., you will need larger delays on faster
  8664. machines to achieve the same effect. This can only be
  8665. considered a flaw in DOS.
  8666.  
  8667. Note that shorter waiting periods will improve response time
  8668. for your program, but may adversely affect the network.
  8669. Normally, you should use the longest waiting period with which
  8670. you feel comfortable.
  8671.  
  8672.    Retries Times%, WaitTime%
  8673.  
  8674. Times%     # of times to retry if file-sharing violation occurs
  8675. WaitTime%  amount of time to delay between retries
  8676.  
  8677. Name  : Reverse              (Reverse)
  8678. Class : String
  8679. Level : Any
  8680.  
  8681. This little fellow reverses the order of the characters in a
  8682. string.  It is one of the vital components of RInstr, but other
  8683. than that I see no real use for it.  On the other hand, George
  8684. Boole thought that Boolean logic was of solely theoretical
  8685. interest, and yet without it there would be no computers. I
  8686. leave it to you to find the earth-shattering possibilities of
  8687. Reverse!
  8688.  
  8689.    Reverse St$
  8690.  
  8691. St$      string to be reversed
  8692. -------
  8693. St$      reversed string
  8694.  
  8695. Name  : ReverseD             (Reverse Double precision array)
  8696. Class : Array management
  8697. Level : Any
  8698.  
  8699. This routine reverses the elements in an array of
  8700. double-precision numbers. This will probably be most useful for
  8701. an array sorted by SortD, in case you want the numbers to go
  8702. from largest to smallest.
  8703.  
  8704. The array is assumed to start at element 1.  You may specify
  8705. the last element in the array, allowing you to reverse only
  8706. part of an array if you like.
  8707.  
  8708.    ReverseD Array#(), Elements%
  8709.  
  8710. Array#()    array to be reversed
  8711. Elements%   number of elements in array
  8712. -------
  8713. Array#()    reversed array
  8714.  
  8715. Name  : ReverseI             (Reverse Integer array)
  8716. Class : Array management
  8717. Level : Any
  8718.  
  8719. This routine reverses the elements in an array of integers.
  8720. This will probably be most useful for an array sorted by SortI,
  8721. or a pointer array used in PSortD, PSortI, PSortL, PSortS, or
  8722. PSortSt, in case you want the values to go from largest to
  8723. smallest.
  8724.  
  8725. The array is assumed to start at element 1.  You may specify
  8726. the last element in the array, allowing you to reverse only
  8727. part of an array if you like.
  8728.  
  8729.    ReverseI Array%(), Elements%
  8730.  
  8731. Array%()    array to be reversed
  8732. Elements%   number of elements in array
  8733. -------
  8734. Array%()    reversed array
  8735.  
  8736. Name  : ReverseL             (Reverse Long integer array)
  8737. Class : Array management
  8738. Level : Any
  8739.  
  8740. This routine reverses the elements in an array of long
  8741. integers.  This will probably be most useful for an array
  8742. sorted by SortL, in case you want the values to go from largest
  8743. to smallest.
  8744.  
  8745. The array is assumed to start at element 1.  You may specify
  8746. the last element in the array, allowing you to reverse only
  8747. part of an array if you like.
  8748.  
  8749.    ReverseL Array&(), Elements%
  8750.  
  8751. Array&()    array to be reversed
  8752. Elements%   number of elements in array
  8753. -------
  8754. Array&()    reversed array
  8755.  
  8756. Name  : ReverseS             (Reverse Single precision array)
  8757. Class : Array management
  8758. Level : Any
  8759.  
  8760. This routine reverses the elements in an array of
  8761. single-precision numbers. This will probably be most useful for
  8762. an array sorted by SortS, in case you want the numbers to go
  8763. from largest to smallest.
  8764.  
  8765. The array is assumed to start at element 1.  You may specify
  8766. the last element in the array, allowing you to reverse only
  8767. part of an array if you like.
  8768.  
  8769.    ReverseS Array!(), Elements%
  8770.  
  8771. Array!()    array to be reversed
  8772. Elements%   number of elements in array
  8773. -------
  8774. Array!()    reversed array
  8775.  
  8776. Name  : ReverseSt            (Reverse String array)
  8777. Class : Array management
  8778. Level : Any
  8779.  
  8780. This routine reverses the elements in a string array.  This
  8781. will probably be most useful for an array sorted by SortSt, in
  8782. case you want the strings to be in reverse-alphabetical order.
  8783.  
  8784. The array is assumed to start at element 1.  You may specify
  8785. the last element in the array, allowing you to reverse only
  8786. part of an array if you like.
  8787.  
  8788.    ReverseSt Array$(), Elements%
  8789.  
  8790. Array$()    array to be reversed
  8791. Elements%   number of elements in array
  8792. -------
  8793. Array$()    reversed array
  8794.  
  8795. Name  : RInstr               (Reverse INSTR)
  8796. Class : String
  8797. Level : Any
  8798.  
  8799. Like INSTR, this routine tells you the position of a substring
  8800. within a string.  A "reverse" search is used, however-- whereas
  8801. INSTR tells you the first match, RInstr tells you the last
  8802. match.  Similarly, whereas INSTR will tell you that a null
  8803. search string matches the main string at the first position,
  8804. RInstr will match on the last position.  Of course, most of the
  8805. time you won't be searching for a null string!
  8806.  
  8807.    RInstr MainSt$, SeekSt$, Posn%
  8808.  
  8809. MainSt$    string to search
  8810. SeekSt$    string for which to search
  8811. -------
  8812. Posn%      position of substring within main string (0 no match)
  8813.  
  8814. Name  : RolSt                (Rotate Left String of bits)
  8815. Class : String
  8816. Level : Any
  8817.  
  8818. This routine rotates the bits in a string left by a desired
  8819. amount.  This may be helpful for manupulating strings
  8820. containing bit flags, images, et al.
  8821.  
  8822.    RolSt St$, Count%
  8823.  
  8824. St$       string to rotate left
  8825. Count%    bits by which to rotate
  8826. -------
  8827. St$       rotated string
  8828.  
  8829. Name  : RorSt                (Rotate Right String of bits)
  8830. Class : String
  8831. Level : Any
  8832.  
  8833. This routine rotates the bits in a string right by a desired
  8834. amount.  This may be helpful for manupulating strings
  8835. containing bit flags, images, et al.
  8836.  
  8837.    RorSt St$, Count%
  8838.  
  8839. St$       string to rotate right
  8840. Count%    bits by which to rotate
  8841. -------
  8842. St$       rotated string
  8843.  
  8844. Name  : RRotate              (Right Rotate String)
  8845. Class : String
  8846. Level : Any
  8847.  
  8848. This routine rotates the characters in a string right once.
  8849. I'll admit that I haven't found a use for this myself, but
  8850. people are always coming up with new uses for things... and it
  8851. complements the more useful LRotate routine.
  8852.  
  8853. See also LRotate.
  8854.  
  8855.    RRotate St$
  8856.  
  8857. St$      string to be rotated right once
  8858. -------
  8859. St$      string after being rotated right once
  8860.  
  8861. Name  : RScroll              (Right Scroll)
  8862. Class : Display
  8863. Level : Clone
  8864.  
  8865. This routine scrolls any selected part of the display right.
  8866. You may scroll as many times as you like, or scroll "zero"
  8867. times to totally clear the selected part of the display.
  8868.  
  8869.    RScroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  8870.  
  8871. TopRow%      top row of the area to scroll
  8872. LeftCol%     left column of the area to scroll
  8873. BottomRow%   top row of the area to scroll
  8874. RightCol%    left column of the area to scroll
  8875. Times%       number of times (or rows) to scroll
  8876.  
  8877. Name  : ScanKey              (Scan Keyboard)
  8878. Class : Input
  8879. Level : BIOS
  8880.  
  8881. This one's like INKEY$, but a little bit more subtle.  It will
  8882. tell you if there's a key waiting (and if so, what key it is)
  8883. without actually getting the key.  The key will remain
  8884. available for later retrieval.
  8885.  
  8886. Among the more common uses for this routine is to handle keys
  8887. like Control-S (pause the display) and Control-C (abort).  You
  8888. can see if these keys have been pressed without disturbing
  8889. anything else the user might have typed.  DOS uses exactly this
  8890. technique for handling these keys.  Since BASIC doesn't go
  8891. through DOS I/O, though, the only way for you to support such
  8892. nice features is to write them into your program with ScanKey.
  8893.  
  8894.    ScanKey CharCode%, CharType%
  8895.  
  8896. -------
  8897. CharType%   key type: 0 none, 1 normal, 2 extended (scan code)
  8898. CharCode%   key ASCII or scan code
  8899.  
  8900. Name  : Scroll               (Scroll)
  8901. Class : Display
  8902. Level : BIOS
  8903.  
  8904. This routine scrolls any selected part of the display up.  You
  8905. may scroll as many times as you like, or scroll "zero" times to
  8906. totally clear the selected part of the display.
  8907.  
  8908. Note that BIOS-level scrolling can cause the screen to flicker
  8909. on some CGAs due to a combination of unfortunate design factors.
  8910.  
  8911.    Scroll TopRow%, LeftCol%, BottomRow%, RightCol%, Times%
  8912.  
  8913. TopRow      top row of the area to scroll
  8914. LeftCol%    left column of the area to scroll
  8915. BottomRow   top row of the area to scroll
  8916. RightCol%   left column of the area to scroll
  8917. Times%      number of times (or rows) to scroll
  8918.  
  8919. Name  : ScrRest              (Screen Restore)
  8920. Class : Display
  8921. Level : Clone
  8922.  
  8923. The ScrRest routine restores a display that was saved using
  8924. ScrSave or a similar routine.  It only works in text modes, and
  8925. expects an 80x25 screen.  See PutScreen or DPutScreen if you
  8926. need to work with other screen sizes.
  8927.  
  8928.    ScrRest Array%(), Page%, Fast%
  8929.  
  8930. Array%()   array holding the display information
  8931. Page%      page on which to restore the display
  8932. Fast%      whether to use fast mode (0 no)
  8933.  
  8934. Name  : ScrSave              (Screen Save)
  8935. Class : Display
  8936. Level : Clone
  8937.  
  8938. The ScrSave routine saves the display to an integer array.
  8939. Only text modes are supported.  For an 80x25 display, the array
  8940. must hold 4,000 bytes, so you would use DIM Array%(1 TO 2000).
  8941.  
  8942. ScrSave expects an 80x25 screen.  Use GetScreen or DGetScreen
  8943. if you need to work with other screen sizes.
  8944.  
  8945.    ScrSave Array%(), Page%, Fast%
  8946.  
  8947. Page%      display page to get
  8948. Fast%      whether to use fast mode (0 no)
  8949. -------
  8950. Array%()   saved display information
  8951.  
  8952. Name  : SCrunch              (Screen Crunch)
  8953. Class : Display
  8954. Level : Any
  8955.  
  8956. This routine is designed to be used in conjunction with ScrSave
  8957. and the other routines which store an entire 80x25 text screen
  8958. in an array.  It performs a "screen crunch", compressing the
  8959. original data into a new array.  The average result is about 8x
  8960. smaller than the original screen, resulting in a vast savings
  8961. in memory (4,000 bytes vs 500 or so).  The compression
  8962. algorithm is very fast and will not take any noticeable amount
  8963. of time for most purposes.
  8964.  
  8965. Besides saving main memory, this is great for storing screens
  8966. as disk files! The compression will not only make the file(s)
  8967. smaller, but will make disk access faster since there is less
  8968. information to transfer.
  8969.  
  8970.    SCrunch DSeg%, DOfs%, CSeg%, COfs%, Bytes%
  8971.  
  8972. DSeg%     segment of the original screen image
  8973. DOfs%     offset of the original screen image
  8974. CSeg%     segment of array in which to store compressed image
  8975. COfs%     offset of array in which to store compressed image
  8976. -------
  8977. Bytes%    number of bytes in the compressed image
  8978.  
  8979. Name  : Sec2Time$            (Seconds to Time)
  8980. Class : Time
  8981. Level : Any
  8982.  
  8983. This routine converts the number of seconds past midnight into
  8984. a time string.
  8985.  
  8986.    TimeSt$ = Sec2Time$(Seconds&)
  8987.  
  8988. Seconds&   number of seconds past midnight
  8989. -------
  8990. TimeSt$    time string (TIME$ format)
  8991.  
  8992. Name  : SetBit               (Set Bit)
  8993. Class : Numeric
  8994. Level : Any
  8995.  
  8996. This routine sets a single bit "on" in an integer.  Bits are
  8997. numbered 0-15, with 0 being the least significant bit.
  8998.  
  8999.    SetBit Number%, BitNr%
  9000.  
  9001. Number%    number for which to set bit
  9002. BitNr%     bit number (0-15) to set
  9003. -------
  9004. Number%    number with the specified bit set
  9005.  
  9006. Name  : SetCGAColor          (Set CGA Color)
  9007. Class : Display
  9008. Level : Clone
  9009.  
  9010. This routine allows you to set certain aspects of CGA colors
  9011. which aren't available otherwise.  It is very CGA-specific,
  9012. however, and may not work on EGA or VGA systems.
  9013.  
  9014. The color specified has different meanings in different CGA
  9015. modes.  In the SCREEN 1 graphics mode, it changes the
  9016. background and border color.  In SCREEN 2, however, it allows
  9017. you to change the foreground color.  While you are still stuck
  9018. with a single foreground color, you can choose what that color
  9019. will be.
  9020.  
  9021.    SetCGAColor Colour%
  9022.  
  9023. Colour%    color to set (see above)
  9024.  
  9025. Name  : SetComm              (Set Comm port)
  9026. Class : Serial
  9027. Level : DOS
  9028.  
  9029. Although QuickBASIC has a fair range of communications support,
  9030. it doesn't do the capabilities of the PC full justice.  It's
  9031. also impossible to change the serial parameters "on the fly"
  9032. without risking disconnection, if BASIC alone is used.  SetComm
  9033. gets around those limitations.  It should be used -after- the
  9034. appropriate comm port is OPENed by BASIC.
  9035.  
  9036. Note that the true upper limits of the comm speed are
  9037. determined by your program and by the hardware being used.
  9038. Some PC/XTs may have trouble with 9,600 bps, for instance.  The
  9039. ability to set the serial port to a high speed doesn't
  9040. guarantee that the hardware can handle it!
  9041.  
  9042.    SetComm CommPort%, Bps%, Parity%, WordLength%, StopBits%
  9043.  
  9044. CommPort%    serial port (1-4, though BASIC only uses 1-2)
  9045. Bps%         bits per second ("baud rate"):
  9046.                 0 for   300       5 for   9,600
  9047.                 1 for   600       6 for  19,200
  9048.                 2 for 1,200       7 for  38,400
  9049.                 3 for 2,400       8 for  57,600
  9050.                 4 for 4,800       9 for 115,200
  9051. Parity%      parity:
  9052.                 0  none
  9053.                 1  odd            3  mark  (always on)
  9054.                 2  even           4  space (always off)
  9055. WordLength%  word length (5-8)
  9056. StopBits%    stop bits (1-2; if WordLength=5, "2" means 1 1/2)
  9057.  
  9058. Name  : SetCommAddr          (Set Comm Address)
  9059. Class : Serial
  9060. Level : Clone
  9061.  
  9062. This routine allows you to set the base port address of a
  9063. serial port.
  9064.  
  9065. One use for SetCommAddr is to give QuickBASIC access to the
  9066. comm port on those unusual machines which have a COM2 but no
  9067. COM1.  Use GetCommAddr to get the address of COM2, set the COM1
  9068. address accordingly, and tell QuickBASIC to use COM1.
  9069.  
  9070. BASIC will normally handle COM1 and COM2, but not COM3 or
  9071. COM4.  Although there is no way to use more two ports at once,
  9072. you can fool BASIC into using COM3 by swapping it with COM1, or
  9073. COM4 by swapping it with COM2.
  9074.  
  9075. Don't forget to set the ports back to their original values
  9076. before your program ends!
  9077.  
  9078.    SetCommAddr PortNr%, PortAddr%
  9079.  
  9080. PortNr%     COM port number (1-4)
  9081. PortAddr%   port address
  9082.  
  9083. Name  : SetDateAT            (Set Date of AT clock)
  9084. Class : Time
  9085. Level : BIOS (AT)
  9086.  
  9087. This routine sets the date of the hardware real-time clock in
  9088. AT-class computers.  Depending on the DOS version, this date
  9089. may be partially or completely independent of the date kept by
  9090. DOS in software.  DOS always reads the date from the hardware
  9091. clock when it starts up.  However, use of the DATE command in
  9092. DOS (and the DATE$ function in QuickBASIC) may relate only to
  9093. the software copy of the date, which is not always guaranteed
  9094. to be the same as the date in the hardware clock due to certain
  9095. discrepancies in DOS.
  9096.  
  9097. You may express the year as either a two-digit or four-digit
  9098. number.
  9099.  
  9100. The ProBas and PBClone versions of this routine do not work the
  9101. same way in regards to the year.  ProBas assumed that any
  9102. two-digit year was in the 1900s.  In contrast, PBClone assumes
  9103. that years 80-99 should be converted to 1980-1999 and that 0-79
  9104. should be converted to 2000-2079.  I consider the PBClone
  9105. method more appropriate, with the turn of the century moving
  9106. closer. The date format used does not allow dates before 1980
  9107. anyway, so nothing is being lost by this change.
  9108.  
  9109.    SetDateAT MonthNr%, DayNr%, YearNr%
  9110.  
  9111. MonthNr%    month number (1-12)
  9112. DayNr%      day (1-31)
  9113. YearNr%     year (1980-2079; see above for two-digit years)
  9114.  
  9115. Name  : SetDrv               (Set default Drive)
  9116. Class : Disk
  9117. Level : DOS
  9118.  
  9119. This routine sets the default disk drive.
  9120.  
  9121. If the specified drive does not exist, the current default
  9122. drive will remain the default.
  9123.  
  9124.    SetDrv Drive$
  9125.  
  9126. Drive$    drive letter
  9127.  
  9128. Name  : SetError             (Set Error code)
  9129. Class : Miscellaneous
  9130. Level : DOS
  9131.  
  9132. The SetError routine allows you to set the "error level" to be
  9133. returned by DOS when your program ends.  This is particularly
  9134. handy for returning information to batch files.
  9135.  
  9136. Note that SetError is best used just before your program ENDs,
  9137. to avoid complications.
  9138.  
  9139.    SetError ErrorLevel%
  9140.  
  9141. ErrorLevel%   exit code to be returned by your program
  9142.  
  9143. Name  : SetFAttr             (Set File Attribute)
  9144. Class : Disk
  9145. Level : DOS
  9146.  
  9147. This routine allows you to set the attribute of a file or
  9148. subdirectory.  Any combination of the following may be set:
  9149.  
  9150.    Normal          0      (nothing special)
  9151.    Read Only       1      file can be read, but not written to
  9152.    Hidden          2      file will be "invisible"
  9153.    System          4      (for special DOS files-- leave alone)
  9154.    Archive        32      (used by some backup utils- leave be)
  9155.  
  9156. To set more than one attribute, just add the numbers for the
  9157. desired attributes together.  The attributes marked "leave
  9158. alone" shouldn't be used casually, but if you're sure you know
  9159. what you're doing...
  9160.  
  9161.    SetFAttr FileName$, FAttr%
  9162.  
  9163. FileName$   name of the file (or subdirectory) to manipulate
  9164. FAttr%      attribute(s) to set
  9165.  
  9166. Name  : SetFTD               (Set File Time and Date)
  9167. Class : Disk
  9168. Level : DOS
  9169.  
  9170. This routine lets you set the time and date of a specified
  9171. file.  You may give the year either as two digits or four
  9172. digits.
  9173.  
  9174. The ProBas and PBClone versions of this routine do not work the
  9175. same way in regards to the year.  ProBas assumed that any
  9176. two-digit year was in the 1900s.  In contrast, PBClone assumes
  9177. that years 80-99 should be converted to 1980-1999 and that 0-79
  9178. should be converted to 2000-2079.  I consider the PBClone
  9179. method more appropriate, with the turn of the century moving
  9180. closer. The DOS date format does not allow dates before 1980
  9181. anyway, so nothing is being lost by this change.
  9182.  
  9183. Note that the Second% value, if odd, will be rounded down to an
  9184. even number. This is due to the way DOS compresses the time
  9185. format, rather than any limitation in this routine.
  9186.  
  9187.    SetFTD File$, MonthNr%, DayNr%, YearNr%, HourNr%, _
  9188.      MinuteNr%, SecondNr%
  9189.  
  9190. File$        name of file for which to set the time and date
  9191. MonthNr%     month number (1-12)
  9192. DayNr%       day (1-31)
  9193. YearNr%      year (1980-2079; see above for two-digit years)
  9194. HourNr%      hour (0-23)
  9195. MinuteNr%    minute (0-59)
  9196. SecondNr%    second (0-59; if odd, rounded down to even number)
  9197. -------
  9198. MonthNr%     -1 if there was an error, else unchanged
  9199.  
  9200. Name  : SetKbd               (Set Keyboard toggles)
  9201. Class : Input
  9202. Level : Clone
  9203.  
  9204. The SetKbd routine allows you to set the state of any of the
  9205. four keyboard toggles: Insert, Caps lock, Num lock, and Scroll
  9206. Lock.  You can give your input routines a professional touch by
  9207. setting this toggles instead of making the user remember to do
  9208. so.
  9209.  
  9210. It's considered proper to restore the original keyboard toggles
  9211. before your program exits, unless of course the purpose of the
  9212. program is to leave the toggles in a particular state!  The
  9213. GetKbd routine can be used in conjunction with SetKbd to do
  9214. this.
  9215.  
  9216.    SetKbd Insert%, Caps%, Num%, Scrl%
  9217.  
  9218. Insert%    whether to turn on "insert" mode (0 if no)
  9219. Caps%      whether to turn on "caps lock" (0 if no)
  9220. Num%       whether to put the keypad into numeric mode (0 no)
  9221. Scrl%      whether to turn on "scroll lock" (0 if no)
  9222.  
  9223. Name  : SetLabel             (Set disk volume Label)
  9224. Class : Disk
  9225. Level : DOS
  9226.  
  9227. This routine creates, renames or deletes a disk volume label.
  9228.  
  9229. Note that a disk volume label is essentially a file name
  9230. without an extension.  It can contain any character that can
  9231. normally be in a file name, plus spaces and periods.
  9232.  
  9233.    SetLabel Drive$, Label$, ErrCode%
  9234.  
  9235. Drive$     drive to set label on (use "" for current drive)
  9236. Label$     label to install (use "" to delete current label)
  9237. -------
  9238. ErrCode%   whether there was an error (0 no)
  9239.  
  9240. Name  : SetMatI              (Set Matrix to Integer)
  9241. Class : Numeric
  9242. Level : Any
  9243.  
  9244. This routine sets as many elements of an integer array as you
  9245. like, starting at a specified place in the array.  A good use
  9246. for it is to initialize an array (or a portion of it) to a
  9247. given value.
  9248.  
  9249.    SetMatI DSeg%, DOfs%, Elements%, Value%
  9250.  
  9251. DSeg%      segment of the first array element to add
  9252. DOfs%      offset of the first array element to add
  9253. Elements%  number of array elements to which to add
  9254. Value%     value to which to set each array element
  9255.  
  9256. Name  : SetMatL              (Set Matrix to Long)
  9257. Class : Numeric
  9258. Level : Any
  9259.  
  9260. This routine sets as many elements of an long integer array as
  9261. you like, starting at a specified place in the array.  A good
  9262. use for it is to initialize an array (or a portion of it) to a
  9263. given value.
  9264.  
  9265.    SetMatL DSeg%, DOfs%, Elements%, Value&
  9266.  
  9267. DSeg%      segment of the first array element to add
  9268. DOfs%      offset of the first array element to add
  9269. Elements%  number of array elements to which to add
  9270. Value&     value to which to set each array element
  9271.  
  9272. Name  : SetMouseLoc          (Set Mouse Location)
  9273. Class : Mouse
  9274. Level : BIOS
  9275.  
  9276. This routine allows you to set the current location of the
  9277. mouse cursor.  It doesn't matter if the cursor is visible or
  9278. invisible.  SetMouseLoc is only for use in text mode.
  9279.  
  9280. This routine will not work properly if there is no mouse
  9281. available.  Use the MMCheck routine if you are not sure.
  9282.  
  9283. See also MMSetLoc, which is for use in graphics modes.
  9284.  
  9285.    SetMouseLoc Row%, Column%
  9286.  
  9287. Row%       mouse cursor row
  9288. Column%    mouse cursor column
  9289.  
  9290. Name  : SetPatch             (Set Patch information)
  9291. Class : Disk
  9292. Level : DOS
  9293.  
  9294. This routine is used after FindPatch.  The FindPatch routine
  9295. finds the first DATA statement to be patched.  SetPatch places
  9296. new information in that DATA statement and moves the file
  9297. pointer to the position of the next DATA statement.  Note that
  9298. there must be only one item per DATA statement; this item must
  9299. be a quoted string.  The string in the DATA statement and the
  9300. patch string must be the same length.
  9301.  
  9302. If you need this routine to be able to handle variable-length
  9303. strings, don't fret!  Make the DATA string one character longer
  9304. than the maximum you need, and use the extra character to
  9305. indicate the actual string length:
  9306.    SetPatch CHR$(LEN(St$)) + St$
  9307. Then when you READ St$, decode it like so:
  9308.    St$ = MID$(St$, 2, ASC(St$))
  9309.  
  9310. Routines in this set include FindPatch, SetPatch, PatchDone.
  9311.  
  9312.    SetPatch St$
  9313.  
  9314. St$       string to patch into the current DATA statement
  9315.  
  9316. Name  : SetPrtAddr           (Set Printer Address)
  9317. Class : Printer
  9318. Level : Clone
  9319.  
  9320. This routine allows you to set the base port address of a
  9321. parallel port.
  9322.  
  9323. One use for this routine is to fool BASIC into using a
  9324. different port than LPT1 for LPRINT.  See also PRTSWAP.
  9325.  
  9326. Note that PS/2 systems only have ports 1-3 available.  They use
  9327. the fourth port data area for holding other information.  It
  9328. may be a good idea to restrict yourself to ports 1-3 for
  9329. compatibility purposes, although other computers allow ports
  9330. 1-4.
  9331.  
  9332. Don't forget to set the ports back to their original values
  9333. before your program ends!
  9334.  
  9335.    SetPrtAddr PortNr%, PortAddr%
  9336.  
  9337. PortNr%     LPT port number (1-4 or 1-3 [see above])
  9338. PortAddr%   port address
  9339.  
  9340. Name  : SetSub               (Set default Subdirectory)
  9341. Class : Disk
  9342. Level : DOS
  9343.  
  9344. Just like the DOS CD (or CHDIR) command, this routine allows
  9345. you to change the current subdirectory.  Unlike the
  9346. corresponding DOS command, you may not use a period or double
  9347. period as shorthand for a directory.  However, you may specify
  9348. either an absolute or relative path, as usual, and can also use
  9349. either slashes or backslashes as delimiters.
  9350.  
  9351.    SetSub SubDir$, ErrCode%
  9352.  
  9353. SubDir$    subdirectory name
  9354. -------
  9355. ErrCode%   error code: 0 if no error, else a DOS Error number
  9356.  
  9357. Name  : SetTimeAT            (Set Time of AT clock)
  9358. Class : Time
  9359. Level : BIOS (AT)
  9360.  
  9361. This routine sets the time to the hardware real-time clock in
  9362. AT-class computers.  Depending on the DOS version, this time
  9363. may be partially or completely independent of the time kept by
  9364. DOS in software.  DOS always reads the time from the hardware
  9365. clock when it starts up.  However, use of the TIME command in
  9366. DOS (and the TIME$ function in QuickBASIC) may relate only to
  9367. the software copy of the time, which is not always guaranteed
  9368. to be the same as the time in the hardware clock due to certain
  9369. discrepancies in DOS.
  9370.  
  9371.    SetTimeAT HourNr%, MinuteNr%, SecondNr%
  9372.  
  9373. HourNr%      hour (0-23)
  9374. MinuteNr%    minute
  9375. SecondNr%    second
  9376.  
  9377. Name  : SetVerify            (Set Verify state)
  9378. Class : Disk
  9379. Level : DOS
  9380.  
  9381. The SetVerify routine allows you to set the state of the DOS
  9382. VERIFY flag. When VERIFY is on, some checking is done to make
  9383. sure that writing to the disk works as requested.  The checks
  9384. are not very good, however, and VERIFY slows down disk
  9385. handling, so it is usually better to have VERIFY off.
  9386.  
  9387.    SetVerify VerifyOn%
  9388.  
  9389. VerifyOn%   whether to turn VERIFY on (0 if no)
  9390.  
  9391. Name  : SetVGAColor          (Set VGA Color)
  9392. Class : Display
  9393. Level : BIOS
  9394.  
  9395. This routine sets the color associated with a given color
  9396. number.  The color is specified as a combination of red, green,
  9397. and blue intensities.  Each intensity may range from off (0) to
  9398. very bright (63).
  9399.  
  9400. If you are dealing with more than one color at a time, you may
  9401. find SetVGAPalette more appropriate.
  9402.  
  9403.    SetVGAColor ColorNr%, Red%, Green%, Blue%
  9404.  
  9405. ColorNr%   color number (1-16 or 1-255, depending on VGA mode)
  9406. Red%       red intensity (0-63)
  9407. Green%     green intensity (0-63)
  9408. Blue%      blue intensity (0-63)
  9409.  
  9410. Name  : SetVGAPalette        (Set VGA Palette)
  9411. Class : Display
  9412. Level : BIOS
  9413.  
  9414. This routine allows you to set any number of the VGA palette
  9415. values from a TYPEd array.  The TYPE for the array should be
  9416. defined like this:
  9417.  
  9418.    TYPE Palet
  9419.       IRed AS STRING * 1
  9420.       IBlue AS STRING * 1
  9421.       IGreen AS STRING * 1
  9422.    END TYPE
  9423.  
  9424. This type holds a CHR$-encoded representation of the intensity
  9425. of each component of the color.  The values range from 0-63.
  9426.  
  9427. You can change many palette settings at a time, very quickly,
  9428. with this routine.  This routine is sufficiently faster than
  9429. the BASIC PALETTE statement as to make palette animation (and
  9430. some stupendous special effects) possible.  It may cause
  9431. flickering on displays with less well-designed video BIOS
  9432. chips, however.
  9433.  
  9434. If you only need to set a few colors, you may find SetVGAColor
  9435. more convenient.
  9436.  
  9437.    SetVGAPalette DSeg%, DOfs%, Start%, Colors%
  9438.  
  9439. DSeg%      segment of the palette array
  9440. DOfs%      offset of the palette array
  9441. Start%     color number to start with
  9442. Colors%    number of colors to set
  9443.  
  9444. Name  : SFRead               (String File Read)
  9445. Class : Disk / String
  9446. Level : DOS
  9447.  
  9448. This routine reads a string from a file that was opened by
  9449. FOpen1 or FCreate. The length of the string you provide
  9450. determines how many characters should be read.  If it wasn't
  9451. possible to read all the characters desired, an error code will
  9452. be returned and the BytesRead% value will tell you how many
  9453. characters were actually retrieved.
  9454.  
  9455.    St$ = SPACE$(BytesToRead%)
  9456.    SFRead Handle%, St$, BytesRead%, ErrCode%
  9457.  
  9458. Handle%     handle of the file from which to read
  9459. -------
  9460. St$         data read from the file.  Init to # of chars wanted
  9461. BytesRead%  number of bytes read from the file (if error)
  9462. ErrCode%    error code: 0 if no error, else DOS Error
  9463.  
  9464. Name  : SFWrite              (String File Write)
  9465. Class : Disk / String
  9466. Level : DOS
  9467.  
  9468. This routine writes a string to a file that was opened by
  9469. FOpen1 or FCreate.  The length of the string you provide
  9470. determines how many characters will be written.  If it wasn't
  9471. possible to write the entire string to the file, an error code
  9472. will be returned and the BytesWrit% value will tell you how
  9473. many characters were actually written.
  9474.  
  9475.    SFWrite Handle%, St$, BytesWrit%, ErrCode%
  9476.  
  9477. Handle%     handle of the file to which to write
  9478. St$         data to write to the file.
  9479. -------
  9480. BytesWrit%  number of bytes written to the file (if error)
  9481. ErrCode%    error code: 0 if no error, else DOS Error
  9482.  
  9483. Name  : ShiftL               (Shift Left)
  9484. Class : Numeric
  9485. Level : Any
  9486.  
  9487. This routine shifts the bits in an integer left by a desired
  9488. amount.  The effect of this is similar to multiplying the
  9489. number by a power of two, if the number is positive, but is
  9490. much faster.
  9491.  
  9492.    ShiftL Value%, Count%
  9493.  
  9494. Value%    number to shift left
  9495. Count%    bits by which to shift
  9496. -------
  9497. Value%    shifted number
  9498.  
  9499. Name  : ShiftLL              (Shift Left Long)
  9500. Class : Numeric
  9501. Level : Any
  9502.  
  9503. This routine shifts the bits in a long integer left by a
  9504. desired amount.  The effect of this is similar to multiplying
  9505. the number by a power of two, if the number is positive, but is
  9506. much faster.
  9507.  
  9508.    ShiftLL Value&, Count%
  9509.  
  9510. Value&    number to shift left
  9511. Count%    bits by which to shift
  9512. -------
  9513. Value&    shifted number
  9514.  
  9515. Name  : ShiftR               (Shift Right)
  9516. Class : Numeric
  9517. Level : Any
  9518.  
  9519. This routine shifts the bits in an integer right by a desired
  9520. amount.  The effect of this is similar to dividing the number
  9521. by a power of two, if the number is positive, but is much
  9522. faster.
  9523.  
  9524.    ShiftR Value%, Count%
  9525.  
  9526. Value%    number to shift right
  9527. Count%    bits by which to shift
  9528. -------
  9529. Value%    shifted number
  9530.  
  9531. Name  : ShiftRL              (Shift Right Long)
  9532. Class : Numeric
  9533. Level : Any
  9534.  
  9535. This routine shifts the bits in a long integer right by a
  9536. desired amount. The effect of this is similar to dividing the
  9537. number by a power of two, if the number is positive, but is
  9538. much faster.
  9539.  
  9540.    ShiftRL Value&, Count%
  9541.  
  9542. Value&    number to shift right
  9543. Count%    bits by which to shift
  9544. -------
  9545. Value&    shifted number
  9546.  
  9547. Name  : ShlSt                (Shift Left String of bits)
  9548. Class : String
  9549. Level : Any
  9550.  
  9551. This routine shifts the bits in a string left by a desired
  9552. amount.  This may be helpful for manupulating strings
  9553. containing bit flags, images, et al.
  9554.  
  9555.    ShlSt St$, Count%
  9556.  
  9557. St$       string to shift left
  9558. Count%    bits by which to shift
  9559. -------
  9560. St$       shifted string
  9561.  
  9562. Name  : ShrSt                (Shift Right String of bits)
  9563. Class : String
  9564. Level : Any
  9565.  
  9566. This routine shifts the bits in a string right by a desired
  9567. amount.  This may be helpful for manupulating strings
  9568. containing bit flags, images, et al.
  9569.  
  9570.    ShrSt St$, Count%
  9571.  
  9572. St$       string to shift right
  9573. Count%    bits by which to shift
  9574. -------
  9575. St$       shifted string
  9576.  
  9577. Name  : SInput               (String Input)
  9578. Class : Input
  9579. Level : Clone
  9580.  
  9581. This is a flexible line input routine which supports WordStar
  9582. and DOS-style editing, default entries, key screening, and any
  9583. number of other options.  To keep SInput manageable, the less
  9584. volatile parameters are set with separate routines instead of
  9585. being passed directly.
  9586.  
  9587. The St$ parameter must be set to the maximum desired input
  9588. length.  It may also contain a default entry, in which case
  9589. SLen% should be set to the length of the default entry (set
  9590. SLen% to zero if there is no default entry).
  9591.  
  9592. Character screening is done through selection of valid
  9593. character types.  This may be any combination of the following
  9594. (add the desired types together):
  9595.  
  9596.     1    letters
  9597.     2    digits
  9598.     4    symbols
  9599.    16    graphics (ASCII 128-255)
  9600.    32    spaces
  9601.  
  9602. You can use -1 to allow any character.  You can also make use
  9603. of the NOT operator, e.g. NOT 2 allows everything but digits.
  9604.  
  9605. The ExitCode% returns the key used to terminate input.  This
  9606. will normally be 13 (return) or 27 (esc), but other results may
  9607. be returned depending on how you use the various SInputSet
  9608. routines.  Note that the cursor position is not altered when
  9609. SInput exits, to avoid accidentally scrolling your screen.  You
  9610. are left with full control over the cursor.
  9611.  
  9612. The SInput routine is designed with the idea of input forms and
  9613. windows in mind.  It is not capable of handling more than one
  9614. line of text at a time. It also doesn't know how to wrap at the
  9615. edge of the screen.
  9616.  
  9617. Routines in this series include:
  9618.    SInput, SInputSet, SInputSet1, SInputSet2
  9619.  
  9620. Since everyone has their own ideas about the perfect input
  9621. routine, I have recoded SInput largely in BASIC to allow
  9622. registered PBClone owners to modify it easily.  I've gotten a
  9623. huge number of requests for SInput modifications in the past;
  9624. hopefully this will be the best solution!
  9625.  
  9626.    SInput St$, SLen%, Valid%, MustFill%, VAttr%, ExitCode%
  9627.  
  9628. St$         init to max length of input (may hold default)
  9629. SLen%       length of default entry (0 if none)
  9630. Valid%      valid character types (see above)
  9631. MustFill%   whether input field must be totally filled (0 no)
  9632. VAttr%      color/attribute for input (see CalcAttr)
  9633. -------
  9634. St$         entered string
  9635. SLen%       length of entered string
  9636. ExitCode%   key used to exit (13 for <CR> or 27 for <ESC>)
  9637.  
  9638. Name  : SInputSet            (String Input Settings)
  9639. Class : Input
  9640. Level : Clone
  9641.  
  9642. This is one of a number of routines which allow you to modify
  9643. the default operation of SInput.
  9644.  
  9645. If you allow extended keys (like Alt keys and function keys) to
  9646. exit SInput, the ExitCode% parameter will return the negative
  9647. scan code of the key.
  9648.  
  9649. Routines in this series include:
  9650.    SInput, SInputSet, SInputSet1, SInputSet2
  9651.  
  9652.    SInputSet FillCh$, ExtExit%, BadBeep%, FullBeep%, Fast%
  9653.  
  9654. FillCh$     character used to show field length (default "_")
  9655. ExtExit%    extended keys can be used to exit (default 0, no)
  9656. BadBeep%    beep on invalid keys (default 0, no)
  9657. FullBeep%   beep when input field is full (default 0, no)
  9658. Fast%       use fast display, may make CGA flicker (def 0, no)
  9659.  
  9660. Name  : SInputSet1           (String Input Settings)
  9661. Class : Input
  9662. Level : Clone
  9663.  
  9664. This is one of a number of routines which allow you to modify
  9665. the default operation of SInput.
  9666.  
  9667. If you give SInput a default entry, it will normally place the
  9668. cursor at the end of that entry when input begins.  The
  9669. CurPosn% option here allows you to place the cursor where you
  9670. want it (1 - LEN(St$), or 0 for end of entry).
  9671.  
  9672. Routines in this series include:
  9673.    SInput, SInputSet, SInputSet1, SInputSet2
  9674.  
  9675.    SInputSet1 CurPosn%, FullExit%
  9676.  
  9677. CurPosn%    starting cursor posn within input field (default 0)
  9678. FullExit%   auto-exit when input field is full (default 0, no)
  9679.  
  9680. Name  : SInputSet2           (String Input Settings)
  9681. Class : Input
  9682. Level : Clone
  9683.  
  9684. This is one of a number of routines which allow you to modify
  9685. the default operation of SInput.
  9686.  
  9687. If you allow tabs to exit SInput, the ExitCode% may return an
  9688. additional value: 9 (tab).  A "back tab", by the way, can be
  9689. retrieved if you use SInputSet to allow extended keys to exit
  9690. (back tab would return -15).
  9691.  
  9692. Routines in this series include:
  9693.    SInput, SInputSet, SInputSet1, SInputSet2
  9694.  
  9695.    SInputSet2 Capitalize%, TabExit%
  9696.  
  9697. Capitalize%   whether to capitalize letters (default 0, no)
  9698. TabExit%      whether tab key can to exit (default 0, no)
  9699.  
  9700. Name  : SortD                (Sort Double precision)
  9701. Class : Array management
  9702. Level : Any
  9703.  
  9704. This routine sorts the elements in an array of double-precision
  9705. numbers.
  9706.  
  9707. The array is assumed to start at element 1.  You may specify
  9708. the last element in the array, allowing you to sort only part
  9709. of an array if you like.
  9710.  
  9711. If you would like the results to be largest-to-smallest, rather
  9712. than smallest-to-largest, just call ReverseD after this routine.
  9713.  
  9714.    SortD Array#(), Elements%
  9715.  
  9716. Array#()    array to be sorted
  9717. Elements%   number of elements in array
  9718. -------
  9719. Array#()    sorted array
  9720.  
  9721. Name  : SortI                (Sort Integer)
  9722. Class : Array management
  9723. Level : Any
  9724.  
  9725. This routine sorts the elements in an array of integers.
  9726.  
  9727. The array is assumed to start at element 1.  You may specify
  9728. the last element in the array, allowing you to sort only part
  9729. of an array if you like.
  9730.  
  9731. If you would like the results to be largest-to-smallest, rather
  9732. than smallest-to-largest, just call ReverseI after this routine.
  9733.  
  9734.    SortI Array%(), Elements%
  9735.  
  9736. Array%()    array to be sorted
  9737. Elements%   number of elements in array
  9738. -------
  9739. Array%()    sorted array
  9740.  
  9741. Name  : SortL                (Sort Long integer)
  9742. Class : Array management
  9743. Level : Any
  9744.  
  9745. This routine sorts the elements in an array of long integers.
  9746.  
  9747. The array is assumed to start at element 1.  You may specify
  9748. the last element in the array, allowing you to sort only part
  9749. of an array if you like.
  9750.  
  9751. If you would like the results to be largest-to-smallest, rather
  9752. than smallest-to-largest, just call ReverseL after this routine.
  9753.  
  9754.    SortL Array&(), Elements%
  9755.  
  9756. Array&()    array to be sorted
  9757. Elements%   number of elements in array
  9758. -------
  9759. Array&()    sorted array
  9760.  
  9761. Name  : SortS                (Sort Single precision)
  9762. Class : Array management
  9763. Level : Any
  9764.  
  9765. This routine sorts the elements in an array of single-precision
  9766. numbers.
  9767.  
  9768. The array is assumed to start at element 1.  You may specify
  9769. the last element in the array, allowing you to sort only part
  9770. of an array if you like.
  9771.  
  9772. If you would like the results to be largest-to-smallest, rather
  9773. than smallest-to-largest, just call ReverseS after this routine.
  9774.  
  9775.    SortS Array!(), Elements%
  9776.  
  9777. Array!()    array to be sorted
  9778. Elements%   number of elements in array
  9779. -------
  9780. Array!()    sorted array
  9781.  
  9782. Name  : SortSt               (Sort String)
  9783. Class : Array management
  9784. Level : Any
  9785.  
  9786. This routine sorts the elements in a string array.
  9787.  
  9788. The array is assumed to start at element 1.  You may specify
  9789. the last element in the array, allowing you to sort only part
  9790. of an array if you like.  You can also specify whether the
  9791. capitalization of letters in a string should matter for sorting
  9792. purposes.
  9793.  
  9794. If you would like the results to be last-to-first, rather than
  9795. first-to-last, just call ReverseSt after this routine.
  9796.  
  9797.    SortSt Array$(), Elements%, CapsCount%
  9798.  
  9799. Array$()    array to be sorted
  9800. CapsCount%  use 0 if uppercase/lowercase doesn't matter
  9801. Elements%   number of elements in array
  9802. -------
  9803. Array$()    sorted array
  9804.  
  9805. Name  : Soundex              (Soundex code)
  9806. Class : String
  9807. Level : Any
  9808.  
  9809. This is a string comparison routine which returns a code that
  9810. is loosely based on the "sound" of a word.  It removes the
  9811. vowels and repeated characters from a word, then converts it
  9812. into a numeric code.  Any words with the same code are
  9813. considered to sound alike.
  9814.  
  9815. While not perfect, this algorithm does a fast and reasonably
  9816. good job.  It can be helpful in applications like spelling
  9817. checkers and phone books, where a search based on exact text
  9818. may not be appropriate.
  9819.  
  9820.    Code$ = St$
  9821.    Soundex St$, Code$, CodeLen%
  9822.    Code$ = LEFT$(St$, CodeLen%)
  9823.  
  9824. St$       string to be encoded
  9825. -------
  9826. Code$     result code.  Init to >= length of original string.
  9827. CodeLen%  length of the result code
  9828.  
  9829. Name  : SpeedKey             (Speed up Keyboard)
  9830. Class : Input
  9831. Level : BIOS (AT)
  9832.  
  9833. This routine provides control over the keyboard repeat rate for
  9834. AT-class machines.  Increasing the repeat rate can make the
  9835. computer seem a lot more responsive and pleasant to deal with.
  9836.  
  9837.   RepDelay%   Delay Time
  9838.      0        250 milliseconds
  9839.      1        500 ms
  9840.      2        750 ms
  9841.      3        1 second
  9842.  
  9843.   RepRate% is the key repeat rate, 0-31 (from around 30 cps to
  9844.   around 2 cps)
  9845.  
  9846.    SpeedKey RepDelay%, RepRate%
  9847.  
  9848. RepDelay%   delay before starting to repeat (0-3, default 1)
  9849. RepRate%    rate at which to repeat key (0-31, default 11)
  9850.  
  9851. Name  : Split                (Split screen image)
  9852. Class : Display
  9853. Level : Clone
  9854.  
  9855. This provides an elegant way to clear a text-mode screen.  It
  9856. splits the display into four parts, scrolling each part up or
  9857. down until it slides off the screen.
  9858.  
  9859.    Split
  9860.  
  9861. Name  : Spooler              (check for print Spooler)
  9862. Class : Printer
  9863. Level : DOS
  9864.  
  9865. The Spooler routine allows you to see whether the print spooler
  9866. (installed by the DOS PRINT utility) is available.
  9867.  
  9868.    Spooler Status%
  9869.  
  9870. -------
  9871. Status%   spooler status:
  9872.              -1   it's installed
  9873.               0   it isn't installed, but can be
  9874.               1   it isn't installed, and can't be
  9875.  
  9876. Name  : SSrch                (String Search)
  9877. Class : String
  9878. Level : Any
  9879.  
  9880. This is a string search routine which tells you whether one
  9881. string can be found inside another.  Uppercase/lowercase
  9882. distinctions are ignored.  Leading and trailing spaces in the
  9883. string for which to search are also ignored.
  9884.  
  9885. Note that the positions of the main string and search string
  9886. parameters are in the reverse of the order you might expect.
  9887.  
  9888.    SSrch Search$, MainSt$, Found%
  9889.  
  9890. Search$   string for which to search
  9891. MainSt$   string to be searched
  9892. -------
  9893. Found%    whether a match was found (0 if no)
  9894.  
  9895. Name  : StrDel               (String Delete)
  9896. Class : String
  9897. Level : Any
  9898.  
  9899. StrDel deletes a character from a string.  Actually, it doesn't
  9900. make the string any shorter, but it acts like a delete.  The
  9901. end of the string is filled with a space.
  9902.  
  9903.    StrDel St$, Posn%
  9904.  
  9905. St$       string from which to delete a character
  9906. Posn%     position of the character to delete (1-LEN(St$))
  9907. -------
  9908. St$       processed string
  9909.  
  9910. Name  : StrIns               (String Insert)
  9911. Class : String
  9912. Level : Any
  9913.  
  9914. StrIns inserts a space into a string.  Actually, it doesn't
  9915. make the string any longer, but it acts like an insert.  The
  9916. former end of the string is discarded.
  9917.  
  9918.    StrIns St$, Posn%
  9919.  
  9920. St$       string in which to insert a space
  9921. Posn%     where to insert the space (1-LEN(St$))
  9922. -------
  9923. St$       processed string
  9924.  
  9925. Name  : Strip                (Strip spaces)
  9926. Class : String
  9927. Level : Any
  9928.  
  9929. This routine strips both leading and trailing white space from
  9930. a string. This includes control characters as well as blanks
  9931. (anything below CHR$(33)).
  9932.  
  9933.    Strip St$
  9934.  
  9935. St$      string to process
  9936. -------
  9937. St$      processed string
  9938.  
  9939. Name  : Strip2$              (Strip Spaces)
  9940. Class : String
  9941. Level : Any
  9942.  
  9943. This routine strips both leading and trailing white space from
  9944. a string.  It works just like Strip, but is a function rather
  9945. than a subprogram.  White space includes control characters as
  9946. well as blanks (anything below CHR$(33)).
  9947.  
  9948.    Result$ = Strip2$(St$)
  9949.  
  9950. St$       string to process
  9951. -------
  9952. Result$   processed string
  9953.  
  9954. Name  : StripBlanks          (Strip Blanks)
  9955. Class : String
  9956. Level : Any
  9957.  
  9958. This routine strips leading and/or trailing white space from a
  9959. string.  This includes control characters as well as blanks
  9960. (anything below CHR$(33)).
  9961.  
  9962. See also StripSpaces.
  9963.  
  9964.    StripBlanks St$, Which%, StLen%
  9965.    St$ = LEFT$(St$, StLen%)
  9966.  
  9967. St$      string to process
  9968. Which%   1: strip left, 2: strip right, 3: strip left and right
  9969. -------
  9970. St$      processed string
  9971. StLen    length of processed string
  9972.  
  9973. Name  : StripChar            (Strip Characters)
  9974. Class : String
  9975. Level : Any
  9976.  
  9977. This routine strips all occurrences of a given list of
  9978. characters out of a string.  Among the uses for this are
  9979. cleaning up user-entered values.  For instance, a strip list of
  9980. "$," would remove commas and dollar signs from a number, and
  9981. "()- " will remove telephone delimiters.
  9982.  
  9983.    StripChar St$, StripList$, StLen%
  9984.    St$ = LEFT$(St$, StLen%)
  9985.  
  9986. St$         string to process
  9987. StripList$  characters to remove from the string
  9988. -------
  9989. St$         processed string
  9990. StLen%      length of processed string
  9991.  
  9992. Name  : StripRange           (Strip Range of characters)
  9993. Class : String
  9994. Level : Any
  9995.  
  9996. This routine strips an inclusive range of characters out of a
  9997. string.  The range is specified as the first and last ASCII
  9998. codes to strip.  For instance, using a low character of "0" and
  9999. a high of "9" would remove all digits from a string.
  10000.  
  10001.    StripRange St$, ASC(LowChar$), ASC(HighChar$), StLen%
  10002.    St$ = LEFT$(St$, StLen%)
  10003.  
  10004. St$         string to process
  10005. LowChar$    lowest character to strip
  10006. HighChar$   highest character to strip
  10007. -------
  10008. St$         processed string
  10009. StLen%      length of processed string
  10010.  
  10011. Name  : StripSpaces          (Strip Spaces)
  10012. Class : String
  10013. Level : Any
  10014.  
  10015. This routine strips leading and/or trailing spaces from a
  10016. string.
  10017.  
  10018. See also StripBlanks.
  10019.  
  10020.    StripSpaces St$, Which%, StLen%
  10021.    St$ = LEFT$(St$, StLen%)
  10022.  
  10023. St$      string to process
  10024. Which%   1: strip left, 2: strip right, 3: strip left and right
  10025. -------
  10026. St$      processed string
  10027. StLen%   length of processed string
  10028.  
  10029. Name  : StrSqu$              (String Squish)
  10030. Class : String
  10031. Level : Any
  10032.  
  10033. This is a text compression routine which uses 2-gram and 3-gram
  10034. compression to shrink a string.  It combines the best of the
  10035. StrSqu2 and StrSqu3 routines with additional ease of use. The
  10036. one limitation is that only plain text may be compressed; the
  10037. text may not contain CHR$(128) through CHR$(255), as these
  10038. codes are used by the compression algorithm.
  10039.  
  10040. The compressed text can be restored to original form with the
  10041. StrUnsq$ function.
  10042.  
  10043.    Result$ = StrSqu$(St$)
  10044.  
  10045. St$       string to compress
  10046. -------
  10047. Result$   compressed string
  10048.  
  10049. Name  : StrSqu2              (String Squish, 2-gram)
  10050. Class : String
  10051. Level : Any
  10052.  
  10053. This is a text compression routine which uses a 2-gram
  10054. algorithm to compress common pairs of characters out of a
  10055. string.  You can reasonably expect to reduce the text size by
  10056. about a third with this routine.  Compression is quite fast.
  10057. The one limitation is that only plain text may be compressed;
  10058. the text may not contain CHR$(128) through CHR$(255), as these
  10059. codes are used by the compression algorithm.
  10060.  
  10061. You must use StrSquLen2 before this routine to determine the
  10062. proper length to which to initialize the result string.
  10063.  
  10064. The compressed text can be restored to original form with
  10065. StrUnsqu2.
  10066.  
  10067.    StrSquLen2 St$, ResultLen%
  10068.    Result$ = SPACE$(ResultLen%)
  10069.    StrSqu2 St$, Result$
  10070.  
  10071. St$       string to compress
  10072. -------
  10073. Result$   compressed string
  10074.  
  10075. Name  : StrSqu3              (String Squish, 3-gram)
  10076. Class : String
  10077. Level : Any
  10078.  
  10079. This is a text compression routine which uses a 3-gram
  10080. algorithm to compress common triplets of characters out of a
  10081. string.  You can reasonably expect to reduce the text size by
  10082. about a third with this routine.  Compression is quite fast.
  10083. The one limitation is that only plain text may be compressed;
  10084. the text may not contain CHR$(128) through CHR$(255), as these
  10085. codes are used by the compression algorithm.
  10086.  
  10087. You must use StrSquLen3 before this routine to determine the
  10088. proper length to which to initialize the result string.
  10089.  
  10090. The compressed text can be restored to original form with
  10091. StrUnsqu3.
  10092.  
  10093.    StrSquLen3 St$, ResultLen%
  10094.    Result$ = SPACE$(ResultLen%)
  10095.    StrSqu3 St$, Result$
  10096.  
  10097. St$       string to compress
  10098. -------
  10099. Result$   compressed string
  10100.  
  10101. Name  : StrSquLen2           (String Squished Length, 2-gram)
  10102. Class : String
  10103. Level : Any
  10104.  
  10105. This routine is used in conjunction with the StrSqu2 text
  10106. compressor. It tells you what size the resulting text will be.
  10107. See StrSqu2 for further information.
  10108.  
  10109.    StrSquLen2 St$, ResultLen%
  10110.    Result$ = SPACE$(ResultLen%)
  10111.    StrSqu2 St$, Result$
  10112.  
  10113. St$          string to compress
  10114. -------
  10115. ResultLen%   length of the compressed string
  10116.  
  10117. Name  : StrSquLen3           (String Squished Length, 3-gram)
  10118. Class : String
  10119. Level : Any
  10120.  
  10121. This routine is used in conjunction with the StrSqu3 text
  10122. compressor. It tells you what size the resulting text will be.
  10123. See StrSqu3 for further information.
  10124.  
  10125.    StrSquLen3 St$, ResultLen%
  10126.    Result$ = SPACE$(ResultLen%)
  10127.    StrSqu3 St$, Result$
  10128.  
  10129. St$          string to compress
  10130. -------
  10131. ResultLen%   length of the compressed string
  10132.  
  10133. Name  : StrUnsq$             (String Unsquish)
  10134. Class : String
  10135. Level : Any
  10136.  
  10137. This routine decompresses text which was compressed by the
  10138. StrSqu$ function.
  10139.  
  10140.    Result$ = StrUnsq$(St$)
  10141.  
  10142. St$       string to decompress
  10143. -------
  10144. Result$   decompressed string
  10145.  
  10146. Name  : StrUnsqu2            (String Unsquish, 2-gram)
  10147. Class : String
  10148. Level : Any
  10149.  
  10150. This routine decompresses text which was compressed by
  10151. StrSqu2.  Text is decompressed at lightning speed, as this
  10152. routine has no overhead to speak of.
  10153.  
  10154. You must use StrUnsquLen2 before this routine to determine the
  10155. proper length to which to initialize the result string.
  10156.  
  10157.    StrUnsquLen2 St$, ResultLen%
  10158.    Result$ = SPACE$(ResultLen%)
  10159.    StrUnsqu2 St$, Result$
  10160.  
  10161. St$       string to decompress
  10162. -------
  10163. Result$   decompressed string
  10164.  
  10165. Name  : StrUnsqu3            (String Unsquish, 3-gram)
  10166. Class : String
  10167. Level : Any
  10168.  
  10169. This routine decompresses text which was compressed by
  10170. StrSqu3.  Text is decompressed at lightning speed, as this
  10171. routine has no overhead to speak of.
  10172.  
  10173. You must use StrUnsquLen3 before this routine to determine the
  10174. proper length to which to initialize the result string.
  10175.  
  10176.    StrUnsquLen3 St$, ResultLen%
  10177.    Result$ = SPACE$(ResultLen%)
  10178.    StrUnsqu3 St$, Result$
  10179.  
  10180. St$       string to decompress
  10181. -------
  10182. Result$   decompressed string
  10183.  
  10184. Name  : StrUnsquLen2         (String Unsquished Length, 2-gram)
  10185. Class : String
  10186. Level : Any
  10187.  
  10188. This routine is used in conjunction with the StrUnsqu2 text
  10189. decompressor. It tells you what size the resulting text will
  10190. be.  See StrUnsqu2 for further information.
  10191.  
  10192.    StrUnsquLen2 St$, ResultLen%
  10193.    Result$ = SPACE$(ResultLen%)
  10194.    StrUnsqu2 St$, Result$
  10195.  
  10196. St$          string to decompress
  10197. -------
  10198. ResultLen%   length of the decompressed string
  10199.  
  10200. Name  : StrUnsquLen3         (String Unsquished Length, 3-gram)
  10201. Class : String
  10202. Level : Any
  10203.  
  10204. This routine is used in conjunction with the StrUnsqu3 text
  10205. decompressor. It tells you what size the resulting text will
  10206. be.  See StrUnsqu3 for further information.
  10207.  
  10208.    StrUnsquLen3 St$, ResultLen%
  10209.    Result$ = SPACE$(ResultLen%)
  10210.    StrUnsqu3 St$, Result$
  10211.  
  10212. St$          string to decompress
  10213. -------
  10214. ResultLen%   length of the decompressed string
  10215.  
  10216. Name  : SubExist             (Subdirectory Existence)
  10217. Class : Disk
  10218. Level : DOS
  10219.  
  10220. This routine lets you see if a given drive and/or subdirectory
  10221. actually exists.
  10222.  
  10223. See also SubExist2, the FUNCTION version of this routine.
  10224.  
  10225.    SubExist SubDir$, Found%
  10226.  
  10227. SubDir$   name of the path to check
  10228. -------
  10229. Found%    whether the path exists (0 if no, -1 if yes)
  10230.  
  10231. Name  : SubExist2%           (Subdirectory Existence)
  10232. Class : Disk
  10233. Level : DOS
  10234.  
  10235. This routine lets you see if a given drive and/or subdirectory
  10236. actually exists.
  10237.  
  10238. See also SubExist, the SUB version of this routine.
  10239.  
  10240.    Found% = SubExist2%(SubDir$)
  10241.  
  10242. SubDir$   name of the path to check
  10243. -------
  10244. Found%    whether the path exists (0 if no, -1 if yes)
  10245.  
  10246. Name  : Time2Int             (Time to Integer)
  10247. Class : Time
  10248. Level : Any
  10249.  
  10250. This routine compresses a time into a single integer.  Note
  10251. that this integer is not in a format that lends itself to
  10252. simple computation-- you cannot subtract one from another to
  10253. find out the length of time between them.  If that's what you
  10254. want, try the Elapsed routine.
  10255.  
  10256. Note that odd numbers of seconds will be rounded down to the
  10257. previous even number.  This is a result of the storage format
  10258. used.
  10259.  
  10260.    Time2Int HourNr%, MinuteNr%, SecondNr%, IntTimeNr%
  10261.  
  10262. HourNr%      hour (0-23)
  10263. MinuteNr%    minute
  10264. SecondNr%    second
  10265. -------
  10266. IntTime%     time compressed into an integer
  10267.  
  10268. Name  : Time2Sec&            (Time to Seconds)
  10269. Class : Time
  10270. Level : Any
  10271.  
  10272. This routine converts a time string into the number of seconds
  10273. past midnight. This is convenient if you want to find the
  10274. difference between two times or to calculate what time it will
  10275. be after a given interval.
  10276.  
  10277.    Seconds& = Time2Sec&(TimeSt$)
  10278.  
  10279. TimeSt$    time string (TIME$ format)
  10280. -------
  10281. Seconds&   number of seconds past midnight
  10282.  
  10283. Name  : TimeN2S              (Time Numbers to String)
  10284. Class : Time
  10285. Level : Any / DOS
  10286.  
  10287. Many of the PBClone routines return the time as a set of
  10288. numbers.  This routine provides an easy way to convert those
  10289. numbers into string form.  The time format used (whether
  10290. seconds are included) will be based on the length of the string
  10291. which you pass to the routine.  For instance, a string like
  10292. "xx:xx" would return a time like "21:35", whereas "xx:xx:xx"
  10293. would return "21:35:08".
  10294.  
  10295.    TimeSt$ = "xx:xx:xx"
  10296.    TimeN2S HourNr%, MinuteNr%, SecondNr%, TimeSt$
  10297.  
  10298. HourNr%     hour (0-23)
  10299. MinuteNr%   minute
  10300. SecondNr%   second
  10301. -------
  10302. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  10303.  
  10304. Name  : TimeS2N              (Time String to Numbers)
  10305. Class : Time
  10306. Level : Any
  10307.  
  10308. Many of the PBClone routines need to be passed the time as a
  10309. set of numbers. This routine provides an easy way to convert a
  10310. time from string form into numbers.  You may use either
  10311. "xx:xx:xx" or "xx:xx" form to specify the time (the string
  10312. length is important, but the delimiter and contents of the
  10313. string are ignored).  If the 5-character short form is used,
  10314. the Second% value will be zero.
  10315.  
  10316.    TimeS2N HourNr%, MinuteNr%, SecondNr%, TimeSt$
  10317.  
  10318. TimeSt$     time string.  Init to 5 or 8 characters (see above).
  10319. -------
  10320. HourNr%     hour (0-23)
  10321. MinuteNr%   minute
  10322. SecondNr%   second (0 if 5-char format)
  10323.  
  10324. Name  : TInstr               (Typed INSTR)
  10325. Class : String
  10326. Level : Any
  10327.  
  10328. As you might guess from the "Instr" part of the name, this
  10329. routine searches a string.  Instead of searching for a specific
  10330. character or substring, though, it looks for a specific type of
  10331. character-- letters, numbers, control codes, or whatever.  You
  10332. can search for the first of a combination of types, too, which
  10333. also allows searching for "anything but" a specific type.
  10334.  
  10335. The character type code is specified by adding any of the
  10336. following:
  10337.  
  10338.     1    alphabetic
  10339.     2    numeric
  10340.     4    symbolic
  10341.     8    control
  10342.    16    graphics
  10343.    32    space
  10344.  
  10345. The TInstr routine is handy for parsing and cleaning up user
  10346. input, among other uses.
  10347.  
  10348.    TInstr St$, ChrType%, Place%
  10349.  
  10350. St$          string to search
  10351. ChrType%     type of character(s) to search for
  10352. -------
  10353. Place%       position of first char of desired type, or 0
  10354.  
  10355. Name  : TypeIn               (Type In)
  10356. Class : Input
  10357. Level : Clone
  10358.  
  10359. This is an unusual routine which combines both output and
  10360. input.  It sends a string to the keyboard buffer, where it acts
  10361. as if it had been typed in by someone.  The string may be up to
  10362. 15 key codes in length (anything past 15 keys will be ignored,
  10363. due to the limited length of the keyboard buffer).
  10364.  
  10365. Normal keys can be put into the string simply as characters.
  10366. Extended keys, like Alt-key combinations, arrow keys, and
  10367. function keys, must be encoded as CHR$(0) + CHR$(ScanCode),
  10368. where the ScanCode is the key's scan code.  You can look up
  10369. such scan codes in your BASIC manual or use GetKey to find out
  10370. what they are.  Extended keys, although apparently taking up
  10371. two characters, only take up one space in the keyboard buffer.
  10372. The TypeIn routine allows for this fact.
  10373.  
  10374. Among other things, this routine can be used to provide default
  10375. answers to input routines, or to execute another program once
  10376. your program exits.
  10377.  
  10378.    TypeIn St$
  10379.  
  10380. St$     keys to be "typed" into the keyboard buffer
  10381.  
  10382. Name  : TypePrint            (Type Print)
  10383. Class : Display
  10384. Level : Clone
  10385.  
  10386. TypePrint displays a string as if it was being typed.  The
  10387. string is displayed a character at a time, with a delay between
  10388. each character.  You may choose one color to highlight the
  10389. just-displayed character and another color for the character to
  10390. turn after the delay is done.
  10391.  
  10392.    TypePrint St$, Row%, Column%, WaitTime%, TmpAttr%, _
  10393.       VAttr%, Fast%
  10394.  
  10395. St$        string to display
  10396. Row%       row at which to display string
  10397. Column%    column at which to display string
  10398. WaitTime%  delay between chars (milliseconds; 20-60 is decent)
  10399. TmpAttr%   color/attribute for just-displayed character
  10400. VAttr%     color/attribute for character after the delay is up
  10401. Fast%      whether to use fast displays (0 no)
  10402.  
  10403. Name  : UnCalcAttr           (Undo Calculated Attribute)
  10404. Class : Display
  10405. Level : Any
  10406.  
  10407. Many of the display routines in this library require an
  10408. "attribute" rather than foreground and background colors.  An
  10409. attribute is a combination of the foreground and background
  10410. colors in a format which is used by all types of displays when
  10411. in text mode.  The UnCalcAttr routine allows you to decode the
  10412. original colors given the attribute.
  10413.  
  10414. Foreground colors are usually specified as 0-31, with
  10415. backgrounds as 0-7.  If you turn blinking off (see Blink), it
  10416. may be more convenient to express the same thing as foreground
  10417. 0-15, background 0-15.  The CalcAttr routine will accept either
  10418. way of expressing it.
  10419.  
  10420. Note, however, that UnCalcAttr will always return the former
  10421. pair of results, since it has no way of knowing whether Blink
  10422. has been used (foreground 0-31, background 0-15).  The below
  10423. routine shows how to get around this, if needed.
  10424.  
  10425.    UnCalcAttr Foreground%, Background%, VAttr%
  10426.    ' the following is optional and may not be desired...
  10427.    ' it converts colors to "no blink" equivalents (see above)
  10428.    IF Foreground% AND 16 THEN
  10429.       Foreground% = Foreground% - 16
  10430.       Background% = Background% + 8
  10431.    END IF
  10432.  
  10433. VAttr%        color "attribute"
  10434. -------
  10435. Foreground%   foreground color
  10436. Background%   background color
  10437.  
  10438. Name  : UnSCrunch            (Undo Screen Crunch)
  10439. Class : Display
  10440. Level : Any
  10441.  
  10442. This routine is designed to be used in conjunction with ScrRest
  10443. and the other routines which restore an entire 80x25 text
  10444. screen from an array.  It expands screens that were compressed
  10445. by Scrunch to their full original size. The uncompression
  10446. algorithm is very fast and will not take any noticeable amount
  10447. of time for most purposes.
  10448.  
  10449.    REDIM FullScreen%(1 TO 2000)
  10450.    DSeg% = VARSEG(FullScreen%(1))
  10451.    DOfs% = VARPTR(FullScreen%(1))
  10452.    UnSCrunch DSeg%, DOfs%, CSeg%, COfs%
  10453.  
  10454. DSeg%     segment of array in which to store expanded image
  10455. DOfs%     offset of array in which to store expanded image
  10456. CSeg%     segment of the compressed image
  10457. COfs%     offset of the compressed image
  10458.  
  10459. Name  : UnSplit              (Undo Split)
  10460. Class : Display
  10461. Level : Clone
  10462.  
  10463. This routine does the opposite of Split-- instead of clearing
  10464. the screen by scrolling it in different directions, it puts
  10465. text on the screen by scrolling it on from different
  10466. locations.  The effect is quite stunning.
  10467.  
  10468. The information to place on the screen comes from an array that
  10469. you specify which contains a saved screen.  Only 80x25 text
  10470. modes are supported.  Any of the screen save routines (e.g.,
  10471. ScrSave) may be used to load the array.  In a typical case, you
  10472. will use this routine with screens that were created in advance
  10473. and stored to disk for use by your program.
  10474.  
  10475.    UnSplit Scrn%(), Fast%
  10476.  
  10477. Scrn%()   array containing the text to display
  10478. Fast%     whether to use fast mode (0 no)
  10479.  
  10480. Name  : Upcase               (Uppercase)
  10481. Class : String
  10482. Level : Any
  10483.  
  10484. This routine, like BASIC's UCASE$ function, converts a string
  10485. to uppercase. Since it doesn't have to create a new return
  10486. string (a fairly slow process), it's faster than the BASIC
  10487. equivalent.
  10488.  
  10489. The Upcase routine is designed for the U.S. character set.  If
  10490. your program is intended for distribution, you would be well
  10491. advised to use Upcase1 instead, as it supports international
  10492. character sets.
  10493.  
  10494.    Upcase St$
  10495.  
  10496. St$     string to be capitalized
  10497. -------
  10498. St$     capitalized string
  10499.  
  10500. Name  : Upcase1              (Uppercase)
  10501. Class : String
  10502. Level : DOS
  10503.  
  10504. This routine, like BASIC's UCASE$ function, converts a string
  10505. to uppercase. It converts letters in the extended character set
  10506. as well as the usual letters, making it well suited for text
  10507. which may not be in English.
  10508.  
  10509. Note that DOS 5.0 is required for optimal performance.  With
  10510. older DOS versions, this routine makes assumptions about the
  10511. character set which may not be appropriate.
  10512.  
  10513.    Upcase1 St$
  10514.  
  10515. St$     string to be capitalized
  10516. -------
  10517. St$     capitalized string
  10518.  
  10519. Name  : UpcaseI%             (Uppercase Integer char)
  10520. Class : Numeric
  10521. Level : Any
  10522.  
  10523. This function converts a character to uppercase.  Rather than
  10524. taking a string parameter, though, UpcaseI% works on an integer
  10525. which contains an ASCII code.
  10526.  
  10527. The UpcaseI% function is designed for the U.S. character set.
  10528. If your program is intended for distribution, you would be well
  10529. advised to use UpcaseI1% instead, as it supports international
  10530. character sets.
  10531.  
  10532.    CapCh% = UpcaseI%(Ch%)
  10533.  
  10534. Ch%      character to be capitalized
  10535. -------
  10536. CapCh%   capitalized character
  10537.  
  10538. Name  : UpcaseI1%            (Uppercase Integer char)
  10539. Class : Numeric
  10540. Level : DOS
  10541.  
  10542. This function converts a character to uppercase.  Rather than
  10543. taking a string parameter, though, UpcaseI% works on an integer
  10544. which contains an ASCII code.
  10545.  
  10546. Note that DOS 5.0 is required for optimal performance.  With
  10547. older DOS versions, this routine makes assumptions about the
  10548. character set which may not be appropriate.
  10549.  
  10550.    CapCh% = UpcaseI1%(Ch%)
  10551.  
  10552. Ch%      character to be capitalized
  10553. -------
  10554. CapCh%   capitalized character
  10555.  
  10556. Name  : UpdTVScreen          (Update TopView Screen)
  10557. Class : Display
  10558. Level : BIOS
  10559.  
  10560. UpdTVScreen tells a TopView-compatible multitasker to update
  10561. the screen using a specified screen buffer (use GetTVScreen to
  10562. get the buffer location).  Some multitaskers will do this
  10563. automatically, but some won't.  It's safe to use this routine
  10564. either way.
  10565.  
  10566. See also GetDView, GetTView, GetTVScreen.
  10567.  
  10568.    UpdTVScreen DSeg%, DOfs%
  10569.  
  10570. DSeg%       segment of screen buffer
  10571. DOfs%       offset of screen buffer
  10572.  
  10573. Name  : VGARest13            (VGA Restore for SCREEN 13)
  10574. Class : Display
  10575. Level : Clone
  10576.  
  10577. This routine allows you to restore a SCREEN 13 (VGA, 320x200,
  10578. 256 color) display that was saved using VGASave13 (see).
  10579.  
  10580.    VGARest13 DSeg%, DOfs%
  10581.  
  10582. DSeg%        segment of storage array, returned by VARSEG
  10583. DOfs%        offset  of storage array, returned by VARPTR
  10584.  
  10585. Name  : VGASave13            (VGA Save of SCREEN 13)
  10586. Class : Display
  10587. Level : Clone
  10588.  
  10589. This routine allows you to save a SCREEN 13 (VGA, 320x200, 256
  10590. color) display that can be restored using VGARest13 (see).
  10591.  
  10592. The array used to hold the screen must contain 64,000 bytes.
  10593. For an integer array, this means that you must create the array
  10594. by DIM Array%(1 TO 32000).
  10595.  
  10596.    VGASave13 DSeg%, DOfs%
  10597.  
  10598. DSeg%        segment of storage array, returned by VARSEG
  10599. DOfs%        offset  of storage array, returned by VARPTR
  10600.  
  10601. Name  : WeekDay0             (Week Day)
  10602. Class : Time
  10603. Level : DOS
  10604.  
  10605. This routine tells you what the day of the week is, just the
  10606. thing for calendar programs and whatnot.  The day is returned
  10607. as a number from 1-7, which identifies a day from Sunday
  10608. through Saturday.
  10609.  
  10610.    WeekDay0 DayNr%
  10611.  
  10612. -------
  10613. DayNr%     current day
  10614.  
  10615. Name  : WeekDay1             (Week Day)
  10616. Class : Time
  10617. Level : Any
  10618.  
  10619. This routine tells you the day of the week for any given date.
  10620.  
  10621.    WeekDay1 MonthNr%, DayNr%, YearNr%, DayName$
  10622.  
  10623. MonthNr%     month number (1-12)
  10624. DayNr%       day number (1-31)
  10625. YearNr%      year number (1900 on)
  10626. -------
  10627. DayName$     day of the week
  10628.  
  10629. Name  : WinCheck             (Windows Check)
  10630. Class : Equipment
  10631. Level : BIOS
  10632.  
  10633. The WinCheck routine tells you what version of Microsoft
  10634. Windows is in use, if any.  It returns the results as two
  10635. integers containing the major and minor version numbers.  For
  10636. instance, Windows 3.0 would return a major number of 3, minor
  10637. 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  10638. not running, 0.0 will be returned.  NOTE that this routine is
  10639. not able to detect Windows 1.x versions!
  10640.  
  10641.    WinCheck MajorV%, MinorV%
  10642.  
  10643. -------
  10644. MajorV%   major part of the Windows version
  10645. MinorV%   minor part of the Windows version
  10646.  
  10647. Name  : WindowMan2           (Window Manager)
  10648. Class : Display
  10649. Level : Clone
  10650.  
  10651. This routine is identical to WindowManager but for the fact
  10652. that it allows you to design your own custom window frames.
  10653. Please see the description of WindowManager for general
  10654. information.
  10655.  
  10656. These are the additional frame types:
  10657.     6   custom frame composed of a single character
  10658.     7   custom frame composed of the specified 7-character list:
  10659.         top left corner, top middle, top right corner,
  10660.         left middle, right middle,
  10661.         bottom left corner, bottom middle, bottom right corner
  10662.  
  10663.  /------------------------------------------------------------\
  10664.  | A custom frame like this would be defined as frame type 7, |
  10665.  | with a frame string of "/-\||\-/", for instance.           |
  10666.  \------------------------------------------------------------/
  10667.  
  10668.  *************************************************
  10669.  * On the other hand, a frame like this would be *
  10670.  * frame type 6, with a frame string of "*".     *
  10671.  *************************************************
  10672.  
  10673. Note that this routine differs from the ProBas equivalent in
  10674. that it supports full frame definitions through frame type 7
  10675. (ProBas only supports type 6). The other differences mentioned
  10676. under WindowManager are also relevant.
  10677.  
  10678.    WindowMan2 TRow%, LCol%, BRow%, RCol%, Frame%, FSt$,
  10679.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  10680.  
  10681. TRow%       top row of window
  10682. LCol%       left column of window
  10683. BRow%       bottom row of window
  10684. RCol%       right column of window
  10685. Frame%      frame type (see above)
  10686. FSt$        frame definition string (see above)
  10687. Fore%       frame foreground color
  10688. Back%       frame background color
  10689. Grow%       window growing option (see above)
  10690. Shade%      window shadow option (see above)
  10691. TFore%      title foreground color
  10692. Title$      window title ("" if none)
  10693. Page%       display page (normally zero)
  10694. Fast%       whether to use fast mode (0 no)
  10695.  
  10696. Name  : WindowMan3           (Window Manager)
  10697. Class : Display
  10698. Level : Clone
  10699.  
  10700. This routine is identical in function to WindowManager.  The
  10701. parameters are mostly passed as an array, however, instead of
  10702. one by one.  Please see the description of WindowManager for
  10703. general information.
  10704.  
  10705.    WindowMan3 Parm%(), Title$
  10706.  
  10707. Parm%(1)    top row of window
  10708. Parm%(2)    left column of window
  10709. Parm%(3)    bottom row of window
  10710. Parm%(4)    right column of window
  10711. Parm%(5)    frame type (see above)
  10712. Parm%(6)    frame foreground color
  10713. Parm%(7)    frame background color
  10714. Parm%(8)    window growing option (see above)
  10715. Parm%(9)    window shadow option (see above)
  10716. Parm%(10)   title foreground color
  10717. Parm%(11)   display page (normally zero)
  10718. Parm%(12)   whether to use fast mode (0 no)
  10719. Title$      window title ("" if none)
  10720.  
  10721. Name  : WindowMan4           (Window Manager)
  10722. Class : Display
  10723. Level : Clone
  10724.  
  10725. This is an extremely cut-down version of WindowManager,
  10726. providing no more than a simple frame generator.
  10727.  
  10728. These are the available frame types:
  10729.     0   no frame
  10730.     1   single lines
  10731.     2   double lines
  10732.     3   single horizontal, double vertical lines
  10733.     4   double horizontal, single vertical lines
  10734.     5   block graphic lines
  10735.  
  10736. Note that this routine is different from its ProBas equivalent
  10737. in that a new frame type (5) is available.
  10738.  
  10739.    WindowMan4 TRow%, LCol%, BRow%, RCol%, Frame%, VAttr%, _
  10740.       Page%, Fast%
  10741.  
  10742. TRow%       top row of window
  10743. LCol%       left column of window
  10744. BRow%       bottom row of window
  10745. RCol%       right column of window
  10746. Frame%      frame type (see above)
  10747. VAttr%      frame color/attribute (use CalcAttr)
  10748. Page%       display page (normally zero)
  10749. Fast%       whether to use fast mode (0 if no, to avoid snow on CGAs)
  10750.  
  10751. Name  : WindowManager        (Window Manager)
  10752. Class : Display
  10753. Level : Clone
  10754.  
  10755. WindowManager displays a pop-up window according to your
  10756. specifications.  The window may have any of a variety of
  10757. frames, a title, or a shadow, and it may appear instantly or
  10758. "grow" onto the screen.  Only text mode is supported.
  10759.  
  10760. These are the available frame types:
  10761.     0   no frame
  10762.     1   single lines
  10763.     2   double lines
  10764.     3   single horizontal, double vertical lines
  10765.     4   double horizontal, single vertical lines
  10766.     5   block graphic lines
  10767.  
  10768. These are the available shadows:
  10769.    -3   transparent shadow on the right
  10770.    -2   transparent shadow on the left
  10771.    -1   solid black shadow on the left
  10772.     0   no shadow
  10773.    1+   shadow attribute (use CalcAttr) for a colored shadow
  10774.  
  10775. Options for growing windows are as follows:
  10776.    -1   grow as fast as possible
  10777.     0   pop onto the screen
  10778.    1+   grow with delay given in milliseconds (15 works for me)
  10779.  
  10780. Note that this routine is different from its ProBas equivalent
  10781. in a number of respects.  The grow delay time is different.
  10782. Growing is done more smoothly. The shadow and title parameters
  10783. are not changed by this routine.  A new frame type (5) was
  10784. added.  If a title is too long, it is truncated instead of
  10785. being ignored completely.  Using a -1 as the title foreground
  10786. color will not turn off the title; instead, use a null title
  10787. string.
  10788.  
  10789.    WindowManager TRow%, LCol%, BRow%, RCol%, Frame%,
  10790.       Fore%, Back%, Grow%, Shade%, TFore%, Title$, Page%, Fast%
  10791.  
  10792. TRow%       top row of window
  10793. LCol%       left column of window
  10794. BRow%       bottom row of window
  10795. RCol%       right column of window
  10796. Frame%      frame type (see above)
  10797. Fore%       frame foreground color
  10798. Back%       frame background color
  10799. Grow%       window growing option (see above)
  10800. Shade%      window shadow option (see above)
  10801. TFore%      title foreground color
  10802. Title$      window title ("" if none)
  10803. Page%       display page (normally zero)
  10804. Fast%       whether to use fast mode (0 no)
  10805.  
  10806. Name  : WriteBitF            (Write Bit Field)
  10807. Class : Numeric
  10808. Level : Any
  10809.  
  10810. This routine allows you to set an element of a virtual array.
  10811. The actual array can be any numeric type, as it is just being
  10812. used as a storage area. The virtual array is composed of
  10813. numbers of a bit length that you specify (1-8).  This provides
  10814. efficient storage for numbers which have a limited range.
  10815.  
  10816. Here's how you DIM the actual array, assuming an integer array
  10817. is used:
  10818.    DIM Array%(1 TO (VirtElements * VirtBits + 15) \ 16)
  10819.  
  10820. "VirtElements" is the number of elements in the virtual array
  10821. and "VirtBits" is the number of bits per element.
  10822.  
  10823. See also ReadBitF.
  10824.  
  10825.    WriteBitF DSeg%, DOfs%, ElementNr&, BitLen%, Value%
  10826.  
  10827. DSeg%        segment of actual array
  10828. DOfs%        offset of actual array
  10829. ElementNr&   virtual element number (starts at 0)
  10830. BitLen%      bits per virtual element (1-8)
  10831. Value%       value to set element to (range depends on BitLen%)
  10832.  
  10833. Name  : Xlate                (Translate)
  10834. Class : String
  10835. Level : Any
  10836.  
  10837. The Xlate routine allows for translating a string, character by
  10838. character, very quickly.  It uses a translation table that you
  10839. provide.  This table is 256 bytes long, one byte for each
  10840. character in the ASCII table.  The translation is done by
  10841. position-- for instance, if the original character was "A"
  10842. (ASCII 65), the translated character will be whatever is in the
  10843. translation table at position 66.  Why 66, when "A" is 65?
  10844. Because ASCII runs from 0-255, but the translation string is
  10845. 1-256: everything is one higher in the string than the ASCII
  10846. character it represents.
  10847.  
  10848. Translation capabilities are handy in communications software.
  10849. They can also be used in other things.  One simple use would be
  10850. to set up a translation table where all lowercase characters
  10851. would be converted to uppercase.  You might ask why, since
  10852. BASIC has a UCASE$ function and PBClone has an Upcase routine.
  10853. Well, Upcase is faster than UCASE$, since it doesn't have to
  10854. create a return string; but Xlate would be even faster, since
  10855. it translates every character directly instead of deciding
  10856. whether it's a lowercase letter!
  10857.  
  10858. Simple encoding, WordStar file decryption, string reversal,
  10859. uppercase / lowercase conversion, and many other things can be
  10860. done with Xlate.
  10861.  
  10862. Remember to initialize all 256 characters in the translation
  10863. table!
  10864.  
  10865.    Xlate St$, XlateTable$
  10866.  
  10867. St$          string to translate
  10868. XlateTable$  translation table
  10869. -------
  10870. St$          translated string
  10871.  
  10872. Name  : XMPrint              (Translate and MS-DOS Print)
  10873. Class : Display
  10874. Level : DOS
  10875.  
  10876. A combination of the Xlate and DMPrint routines, this 'un
  10877. allows you to display using DOS services while being able to
  10878. translate or screen out characters.  Each character of the
  10879. string to display is passed through a translation table you
  10880. provide (256 bytes, where each position corresponds directly to
  10881. the ASCII code of the same number [0-255]).  If the result is
  10882. 0, the character is not displayed.  Otherwise, the translated
  10883. character is displayed using DOS display services.  The new
  10884. cursor position is returned so you can inform BASIC about it.
  10885.  
  10886. Note that the new cursor position may not be accurate!  Some
  10887. ANSI drivers do not update the BIOS cursor position info, in
  10888. which case the results won't be useful.  That's a hazard of
  10889. using DOS output.
  10890.  
  10891.    XMPrint St$, XlateTable$, Row%, Column%
  10892.    LOCATE Row%, Column%
  10893.  
  10894. St$          string to display
  10895. XlateTable$  translation table
  10896. -------
  10897. Row%         current row
  10898. Column%      current column
  10899.  
  10900. Name  : XorSt                (XOR String)
  10901. Class : String
  10902. Level : Any
  10903.  
  10904. This routine XORs each byte in one string with the
  10905. corresponding byte in a second string.  The strings must be the
  10906. same length.
  10907.  
  10908.    XorSt St1$, St2$
  10909.  
  10910. St1$      string to XOR
  10911. St2$      string to XOR with
  10912. -------
  10913. St1$      result
  10914.  
  10915. Name  : XQPrint              (Extended Quick Print)
  10916. Class : Display
  10917. Level : Clone
  10918.  
  10919. This routine provides a rather crude, but very fast, display
  10920. capability.  It works like the PRINT statement in BASIC, except
  10921. that it doesn't move the cursor or process control codes.  It
  10922. works only in text modes.
  10923.  
  10924. See also QPrint, a slightly less flexible (but even faster)
  10925. routine.
  10926.  
  10927.    XQPrint St$, Row%, Column%, VAttr%, Page%, Fast%
  10928.  
  10929. St$       string to display
  10930. Row%      starting row
  10931. Column%   starting column
  10932. VAttr%    color/attribute (see CalcAttr)
  10933. Page%     display page (unused on MDA/Herc; normally 0)
  10934. Fast%     whether to use fast mode (0 no)
  10935.  
  10936. Name  : XQPrintOver          (Extended Quick Print Overwrite)
  10937. Class : Display
  10938. Level : Clone
  10939.  
  10940. This routine provides a rather crude, but very fast, display
  10941. capability.  It works like the PRINT statement in BASIC, except
  10942. that it doesn't move the cursor or process control codes.  It
  10943. works only in text modes.
  10944.  
  10945. This is a slightly unusual variant on a print routine.  It
  10946. displays all characters except spaces.  If your string contains
  10947. a space, that position on the screen will be skipped.  In other
  10948. words, it acts kind of like an overlay. This can be handy when
  10949. you have text in alternating colors.
  10950.  
  10951. I came up with this routine when I designed a program with a
  10952. function key display at the bottom of the screen-- the names of
  10953. the function keys were one color and the associated definitions
  10954. were another color.  It was obvious that the easiest way of
  10955. handling that would be to use an "overlay" approach.  The
  10956. function key definitions were laid down with XQPrint.  I then
  10957. overlaid the line with the function key names in a different
  10958. color, using XQPrintOver.
  10959.  
  10960. If you need a "solid" space, rather than a "transparent" space,
  10961. use CHR$(255) instead of CHR$(32).
  10962.  
  10963.    XQPrintOver St$, Row%, Column%, VAttr%, Page%, Fast%
  10964.  
  10965. St$       string to display
  10966. Row%      starting row
  10967. Column%   starting column
  10968. VAttr%    color/attribute (see CalcAttr)
  10969. Page%     display page (unused on MDA/Herc; normally 0)
  10970. Fast%     whether to use fast mode (0 no)
  10971.  
  10972.